GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — leetcode/python/055_Jump_Game.py at master · Weihouye/leetcode Expand file tree/ Copy path055_Jump_Game.pyMore file actions 14 lines (14 loc) · 383 Bytes / Copy path055_Jump_Game.pyFile metadata and controls14 lines (14 loc) · 383 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 class Solution(object): def canJump(self, nums): """ :type nums: List[int] :rtype: bool """ # greedy # https://leetcode.com/articles/jump-game/ length = len(nums) begin = length - 1 for i in reversed(range(length - 1)): if i + nums[i] >= begin: begin = i return not begin |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |