зачем валидатор изменил аргумент на 6 вместо 3?
условие с моим ответом
public class Solution {
public static void main(String[] args) {
System.out.println(getPowerOfTwo(3));
}
public static int getPowerOfTwo(int power) {
int result = 2;
for(int i = 0; i < power - 1; i++) {
result <<= 1;
}
return result;
}
}
решение валидатора
public class Solution {
public static void main(String[] args) {
System.out.println(getPowerOfTwo(6));
}
public static int getPowerOfTwo(int power) {
return 2 << (power - 1);
}
}