给定一个长度为 n 的整数数组 height 。有 n 条垂线,第 i 条线的两个端点是 (i, 0) 和 (i, height[i]) 。 找出其中的两条线,使得它们与 x 轴共同构成的容器可以容纳最多的水。 返回容器可以储存的最大水量。 说明:你不能倾斜容器。 提示: n == height.l Read More
posted @ 2022-06-22 12:07 A-inspire Views(30) Comments(0) Diggs(0) Edit
给定一个字符串 s ,请你找出其中不含有重复字符的 最长子串 的长度。 代码: class Solution { public: int lengthOfLongestSubstring(string s) { int start = 0; int maxCnt = 0; for(int i = 0 Read More
posted @ 2022-06-22 11:11 A-inspire Views(11) Comments(0) Diggs(0) Edit