알고리즘 • 코딩테스트/프로그래머스

[Python, Java, javascript, Go] 두 수의 차 구하기

정의찬123123 2025. 3. 31. 16:13

https://school.programmers.co.kr/learn/courses/30/lessons/120803

[프로그래머스

SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프

programmers.co.kr](https://school.programmers.co.kr/learn/courses/30/lessons/120803)

Python

def solution(num1, num2):
    answer = num1 - num2
    return answer

Java

class Solution {
    public int solution(int num1, int num2) {
        int answer = num1 - num2;
        return answer;
    }
}

Go

func solution(num1 int, num2 int) int {
    return num1 - num2
}

js

function solution(num1, num2) {
    var answer = num1 - num2 ;
    return answer;
}