We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Using loops without brackets when it using only 1 line is totally readable. If you push too much in one line, its not ok. Guys shoud have used ternary operator for real 1 line here. There is basically 2 lines
for(inti=1;i<=n;i++){if(n%i==0)sum+=i;}
This should be like this for 100% readability.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 19: Interfaces
You are viewing a single comment's thread. Return to all comments →
Using loops without brackets when it using only 1 line is totally readable. If you push too much in one line, its not ok. Guys shoud have used ternary operator for real 1 line here. There is basically 2 lines
This should be like this for 100% readability.