134. Gas Station

Sunnyrain·2022년 1월 21일
0

leetcode

목록 보기
4/5

Problem

Problem: https://leetcode.com/problems/gas-station/

Approach

Simple Explanation

1) Gas의 합이 Cost의 합보다 작으면 Travel 불가능
2) 다음 Gas Station으로 갈 때마다 Gas Tank에 Gas-Cost 만큼의 변화가 생기므로 이를 이용

Why?

Complexity

1) Time

2) Space

profile
sunny and rainy at the same time

0개의 댓글