1.题目: 2.解析: 代码: /**1.创建dp表2.初始化3.填表4.返回值*/public int minFallingPathSum(int[][] matrix) {int n matrix.length;int[][] dp new int[n1][n2];int minNum Integer.MAX_VALUE; for(int i 1; i < n; i) dp[i][0]…
题目:
给你字符串 s 和整数 k 。
请返回字符串 s 中长度为 k 的单个子字符串中可能包含的最大元音字母数。
英文中的 元音字母 为(a, e, i, o, u)。
思路:定长滑动窗口 入 更新 出
代码:
class Solution {pub…
42. 接雨水
class Solution {public int trap(int[] height) {int ans 0;Deque<Integer> st new ArrayDeque<>();for(int i 0; i < height.length; i){while(!st.isEmpty() && height[i] > height[st.peek()]){int mid height[st.pop()];if(st.…