- 博客(7)
- 收藏
- 关注
原创 LeetCode刷题笔记----P16 three sum closest
LeetCode刷题笔记----P16 three sum closest0.问题描述Given an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You may assume that each input would have exactl
2020-11-05 10:00:07 127
原创 LeetCode刷题笔记----P15 three sum
LeetCode刷题笔记----P11 Container with most water0.问题描述Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Notice that the solution set must not con
2020-11-04 15:19:11 104
原创 LeetCode刷题笔记----P11 Container with most water
LeetCode刷题笔记----P11 Container with most water0.问题描述Given n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of the line i is at (i, ai) and (i, 0). Find two
2020-11-03 10:25:41 711
原创 LeetCode刷题笔记----P4两个正序数组的中位数
LeetCode刷题笔记----P4两个正序数组的中位数0.问题描述Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.Follow up: The overall run time complexity should be O(log (m+n)).1.归并排序首先想到归并排序合并两数组,再求取中位数,时间复杂度O(m+n)
2020-10-21 20:33:44 120
原创 LeetCode刷题笔记----P2两数相加
LeetCode刷题笔记----P2两数相加0.问题描述You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list.
2020-10-19 10:34:46 133
原创 LeetCode刷题笔记----P1两数之和
LeetCode刷题笔记----P1两数之和0.Vector用法vector<int> a;a.push_back(3);a.size();a.capacity();1.暴力 vector<int> result; int i,j; for(i=0;i<nums.size();i++) { for(j=i+1;j<nums.size();j++){
2020-10-16 16:52:37 158
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人