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.
Thank you. I've got it.
Just ONE_HUNDRED being uppercase should be final.
What would happen if "int n == -15", for example?.. Where is the checking for positive/negative int?
This comment is hidden because it contains spoiler information about the solution
In such a release when (nb_petals == 516) the result is "I love you" while it should be "not at all"...
If you please, can someone explain me in detail why all the tests are passed, but random tests - are not. It's not the only kata when it happens and I don't know how to check it without clean understanding the characters of the tests that I don't see. Please.
import java.util.ArrayList;
import java.util.Arrays;
public class Kata {
public static int[] mergeArrays(int[] first, int[] second) {
ArrayList list = new ArrayList();
for(int i = 0; i < first.length; i++) {
list.add(first[i]);
}
for(int i = 0; i < second.length; i++) {
list.add(second[i]);
}
for(int i = 0; i < list.size()-1; i++) {
for(int j = list.size()-1; j > i+1; j--) {
if(list.get(j) == list.get(i)) list.remove(j);
}
}
int[] result = new int[list.size()];
for(int i = 0; i < result.length; i++) {
result[i] = (int) list.get(i);
}
Arrays.sort(result);
return result;
}
}
Yes, you're right. Thank you so much! I've corrected them.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
OK, I know it but I am somewhat puzzled anyway. I'll think it over again. Thank you so much!
This comment is hidden because it contains spoiler information about the solution