My issue
My code
// Update the code below to solve this problem
import java.util.Scanner;
class Codechef
{
public static void main (String[] args)
{
Scanner scanner = new Scanner(System.in);
int T = scanner.nextInt(); // number of test cases
while (T-- > 0) {
int P = scanner.nextInt(); // score of the participant
int numProblemsSolved = findNumProblemsSolved(P);
System.out.println(numProblemsSolved);
}
}
public static int findNumProblemsSolved(int P) {
if (P % 100 >10 || P > 1000 && P>10) {
return -1; // invalid score
}
return (P % 100) + (P/100);
}
}
Learning course: Solve Programming problems using Java
Problem Link: CodeChef: Practical coding for everyone