문제링크 - 프로그래머스 - 주사위 게임 1
class Solution { public int solution(int a, int b) { int n = a+b; if(n%2==0) { if(a%2==0) { return Math.abs(a-b); } else { return (int) (Math.pow(a,2) + Math.pow(b,2)); } } else { return 2 * n; } } }
좀 잘 푼거 같다 ㅋ 아님 말고