JAVA_LeetCode 2432_The Employee That Worked on the Longest Task 풀이 class Solution { public int hardestWorker(int n, int[][] logs) { // 반복해서 배열별 2번째 요소를 비교한다음, 결과에 따라 값을 바꿔나간다. int id = logs[0][0], max = logs[0][1], diff = 0; for (int i = 1; i < logs.length; i++) { diff = logs[i][1] - logs[i - 1][1]; if(max < diff){ max = diff; id = logs[i][0]; }else if(max == diff) id = Math.min(id, logs[i][0]); } return id; } } * 출처 https://leetcode.com/problems/the-employee-that-worked-on-the-longest-task...
#
JAVA
#
JAVA_LeetCode2432
#
JAVA_LeetCode2432_TheEmployeeThatWorkedontheLongestTask
#
JAVA_TheEmployeeThatWorkedontheLongestTask
#
LeetCode2432_TheEmployeeThatWorkedontheLongestTask