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.
Sorry my mistake, it was not the sample test, it is test 2 of the "Attempt" tests. My code passes the sample test and all of the "Attempt" tests, except for "test2".
The difference between test2 and the sample test is that in the second array, at index 3, instead of it being 361 it's 36100.
And as I said before with the same function in CodeWars and in Eclipse, in codeWars I get "false" and "true" in Eclipse, the latter being the correct answer. ¯\(ツ)/¯
Seems like this is what you call overthinking...
Ooops fogot to remove the sysout...
Actually, the highest voted solution runs just as slowly as mine so ¯\(ツ)/¯
I don't think this code should have passed.... It runs too slowly.
I put them in the same way as the test in the SampleTest :
int[] a = new int[] {121, 144, 19, 161, 19, 144, 19, 11};
int[] b = new int[] {121, 14641, 20736, 36100, 25921, 361, 20736, 361};
boolean result = comp(a, b);
System.out.println(result);
And in this case true is printed while in codeWars it returns false...
This comment is hidden because it contains spoiler information about the solution