![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Leetcode
qzylala
这个作者很懒,什么都没留下…
展开
-
使数组和能被 P 整除
原题链接 class Solution { public: int minSubarray(vector<int>& a, int p) { int n = a.size(); vector<int> s(n + 1); for(int i = 1; i <= n; i++) { s[i] = (s[i - 1] + a[i - 1]) % p; } // mod p原创 2020-09-20 20:20:00 · 237 阅读 · 0 评论 -
Leetcode-42.-Trapping-Rain-Water
title:Leetcode 42. Trapping Rain Water 1. 问题描述 Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. ...原创 2020-02-16 20:01:43 · 105 阅读 · 0 评论 -
Leetcode-32.-Longest-Valid-Parentheses
title: Leetcode 32. Longest Valid Parentheses 1. 问题描述 Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. Example 1...原创 2020-02-15 20:58:50 · 135 阅读 · 0 评论