프로그래머스 -숫자 비교하기

존재들 번호 1수업 2 번매개변수로 지정됩니다. 두 숫자가 같으면 1을, 다르면 -1을 반환하도록 solve 함수를 완성합니다.

  • 0 ≤ 번호 1 ≤ 10,000
  • 0 ≤ 2 번 ≤ 10,000
class Solution {
    public int solution(int num1, int num2) {
        int answer = 0;
        if(num1 == num2) {
            answer = 1;
        } else {
            answer = -1;
        }
        
        return answer;
    }
}

if 문