代码: class Solution { public: int maxArea(vector<int>& height) { int L = 0,R = height.size()-1; int max_Area = 0; while(L<R) { int ans_area = min(heigh Read More
posted @ 2021-10-26 17:59 A-inspire Views(24) Comments(0) Diggs(0) Edit
代码: class Solution { public: void sortColors(vector<int>& nums) { int Left = 0,right = nums.size()-1; int ptr= 0; for(int i = 0;i<nums.size();i++) { i Read More
posted @ 2021-10-26 17:57 A-inspire Views(16) Comments(0) Diggs(0) Edit
class Solution { public: int threeSumClosest(vector<int>& nums, int target) { int res = nums[0]+nums[1]+nums[2]; for(int i = 0;i<nums.size()-2;i++) { Read More
posted @ 2021-10-26 17:56 A-inspire Views(12) Comments(0) Diggs(0) Edit
class Solution { public: int findMaxLength(vector<int>& nums) { int Max_length = 0; unordered_map<int,int> MP; int counter = 0; MP[counter] = -1; for( Read More
posted @ 2021-10-26 17:54 A-inspire Views(17) Comments(0) Diggs(0) Edit
#include<stdio.h> int main() { int a[1005]; int N; scanf("%d",&N); for(int i = 0;i<N;i++) { scanf("%d",&a[i]); } int k = 0; for(int i = 0;i<N;i++) { i Read More
posted @ 2021-10-26 17:53 A-inspire Views(38) Comments(0) Diggs(0) Edit
题目描述 给定两个由大小写字母和空格组成的字符串s1和 s2,它们的长度都不超过 100 个字符。判断压缩掉空格、并忽略大小写后,这两个字符串在是否相等。 解答要求时间限制:1000ms, 内存限制:100MB 输入 输入两个字符串(分两行输入),只包含字母和空格。输入有多组测试,且到文件末尾结束。 Read More
posted @ 2021-10-26 17:42 A-inspire Views(1119) Comments(0) Diggs(0) Edit