All is fixed!
Except suggestion to check for zeros in random tests, because if we create array with 100 elements, one of them would have zero. I wrote test to prove it, it imitates creation of 1 million arrays with 100 elements and all of them contain zero, please take a look:
@Test
void testZeros() throws Exception {
Random random = new Random();
for (int i = 0; i < 1_000_000; i++) {
boolean containsZero = false;
//imitates creation of array with 100 elements
for (int j = 0; j < 100; j++) {
if((random.nextInt(100_000) + "").contains("0")) {
containsZero = true;
}
}
if(!containsZero) {
System.out.println("there is no zero in " + i + "array");
throw new Exception();
}
}
System.out.println("All arrays contains zero");
}
any tips? I have left only this kata left on level 7 in java, need help! I understand that flag encoded in FLAG variable somehow with number 16, I tried to get every 16 letter, I tried to use online auto decoders, please help!
All is fixed!
Except suggestion to check for zeros in random tests, because if we create array with 100 elements, one of them would have zero. I wrote test to prove it, it imitates creation of 1 million arrays with 100 elements and all of them contain zero, please take a look:
@Test
void testZeros() throws Exception {
Random random = new Random();
for (int i = 0; i < 1_000_000; i++) {
boolean containsZero = false;
//imitates creation of array with 100 elements
for (int j = 0; j < 100; j++) {
if((random.nextInt(100_000) + "").contains("0")) {
containsZero = true;
}
}
if(!containsZero) {
System.out.println("there is no zero in " + i + "array");
throw new Exception();
}
}
System.out.println("All arrays contains zero");
}
Please approve Java translation https://www.codewars.com/kumite/623e370c1c0bbd000e2bbab1?sel=623e370c1c0bbd000e2bbab1
any tips? I have left only this kata left on level 7 in java, need help! I understand that flag encoded in FLAG variable somehow with number 16, I tried to get every 16 letter, I tried to use online auto decoders, please help!
Great kata, thank you!
Thanks, you helped me to understand this task