gas station (1) 썸네일형 리스트형 LeetCode: 134번 (Gas Station) [JAVA] 문제 링크 https://leetcode.com/problems/gas-station/ Gas Station - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 풀이 전체적인 풀이 과정은 다음과 같다. 탐색한 구간을 표시할 startIndex, endIndex를 모두 0으로 초기화 do while문을 기반으로 현 시점(endIndex)의 위치의 cost와 gas 값을 누적 변수(acc)에 반영하며 계산하고, endIndex를 하나 증가 이후 누적값이 음수라면 st.. 이전 1 다음