inblog logo
|
stupefyee
    알고리즘문제풀기

    [JAVA 문제 풀이] 203. 주사위 게임 1

    프로그래머스 (181839)
    Stupefyee's avatar
    Stupefyee
    Apr 16, 2025
    [JAVA 문제 풀이] 203. 주사위 게임 1
    Contents
    내가 작성한 코드
    school.programmers.co.kr
    https://school.programmers.co.kr/learn/courses/30/lessons/181839
    notion image
     

    내가 작성한 코드

    class Solution { public int solution(int a, int b) { return a % 2 == 0 && b % 2 == 0 ? Math.abs(a - b) : a % 2 != 0 && b % 2 != 0 ? a * a + b * b : 2 * (a + b); } }
    Share article
    Contents
    내가 작성한 코드

    stupefyee

    RSS·Powered by Inblog