Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Good way of seeying it!
Why are most of the solutions not fullfilling the following instruction?
"The input array should not be modified!"
Hi OlalKeith,
So Math.sqrt(array[i]) is the square root of the array element...
Math.sqrt(array[i]) % 1 (or square root modulo 1)is the reminder of the square root, divided by 1.
If the result is 0, it means the square root is an integer.
ex:
Math.sqrt(16) = 4 --> 4 % 1 = 0 square root is an integer so the new element is the square root : 4
Math.sqrt(17) =~ 4.123 --> 4.123 % 1 =~ 0.123 square root is not an integer so the new element is the square : 17 * 17
Hello , i am new to java.Can someone please explain to me what the if and else is actually doing in your code ?