2020-5 leetcode 1340. 跳躍遊戲 V

1.建立二維數組tmp 來維護柱長排序的信息。web 2.建立一維數組 dp 來維護每一個 從每一個 index 對應的柱子開始,能到達的柱子個數。(根據柱長排序順序來一個一個的求,由高柱子往低柱子跳的邏輯。)數組 class Solution { public: int maxJumps(vector<int>& arr, int d) { int n=arr.size(
相關文章
相關標籤/搜索