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.
- Prepare
- Algorithms
- Debugging
- Smart Number
- Discussions
Smart Number
Smart Number
Sort by
recency
|
118 Discussions
|
Please Login in order to post a comment
C++11 (more at https://github.com/IhorVodko/Hackerrank_solutions/tree/master , feel free to give a star :) )
As people said, if you even press a space anywhere else it gives a compile error instead of a "you modified more than one line" error.
Hint 1: Math.Sqrt does not return an int.
This question got a issue.All test case is paasing & Answer is pssing but still it's showing Wrong answer public static boolean isSmartNumber(int num) { int val = (int) Math.sqrt(num);
if(val*val == num) return true; return false; }
this how i solve it
python :
if val*val ==num and num/val == val:
This is my Java 8 solution, feel free to ask me any questions.
Explaination:
Solution: