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. ¯\(ツ)/¯
@g964:
it's the same test like the Java Variant. It has the same mistake.
@theCrescentKing:
the Java test you give is badly copied. The "Sample Test" is in fact:
1512 guys passed the Java kata.
@nuscheltier
Maybe you could give the input arrays where you fail, your result and the expected result.
31 guys out of a total of 9,958 passed the Rust kata as you could have seen at the top of the page.
I'm having problems at the same test, but from what I gather it should be false and not true. The problem is that both arrays are not the same (36100 is not the square of any of the items in a). But since it's asserted to be true (at least in Rust) I can't finish the kata.
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.
you can print the values of the parameters , for ex: you can use Arrays.toString(array) and print its values.
the same here :)
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...
Did you mutate the input arrays? :)
This comment is hidden because it contains spoiler information about the solution