public int redTicket(int a, int b, int c) { if (a == b && b == c) { // they're all are the same if (a == 2) { // they're all 2 return 10; } else { // they're all the same, but not 2 return 5; } } // if we get to this point, they're not all the same else if (a != b && a != c) { // b and c are both different from a return 1; } else { return 0; } } public int redTicket(int a, int b, int c) { if (a == 2 && b == 2 && c == 2) { // they're all equal to 2 return 10; } else if (a == b && b == c) { // they're all the same value return 5; } else if (a != b && a != c) { // b and c are both different from a return 1; } else { return 0; } }