JAVA_LeetCode 3516_Find Closest Person 풀이 class Solution { public int findClosest(int x, int y, int z) { // z를 기준으로 절대값에 따라 값을 반환한다. int p1 = Math.abs(z - x); int p2 = Math.abs(z - y); return p1 == p2 ? 0 : p1 > p2 ?
2 : 1; } } * 출처 https://leetcode.com/problems/find-closest-person...
JAVA_LeetCode 3516_Find Closest Person에 대한 요약내용입니다.
자세한 내용은 아래에 원문링크를 확인해주시기 바랍니다.