没有合适的资源?快使用搜索试试~ 我知道了~
leetcode分类-Leetcode:leetcode
共122个文件
cpp:73个
py:45个
gitignore:1个
需积分: 5 0 下载量 8 浏览量
2021-06-30
00:01:46
上传
评论
收藏 79KB ZIP 举报
温馨提示
leetcode 分类 #LeetCode 记录 跟风刷leetcode,cxlove刚好练习一下python Leetcode有个很严重的问题,就是大多没有数据范围。 所以我是在尽可能偷懒的情况下用尽可能优的做法。 ##Two Sum 找到数组中两个数的和为Target。 拿个map/c++,HashMap/Java,dict/python维护一下就好了,O(nlgn) ##Median of Two Sorted Arrays 两个有序数组,O(log(m + n))找到中位数。 其实就是在O(log(m + n))找到第K大。 那么只需要二分在某个数组中的个数,那么另外一个数组的个数就确定了。然后只需要check一下是否合法就OK了。 ##Longest Substring Without Repeating Characters 最长的不出现重复字符的子串。 典型的two points问题,枚举左端点,维护右端点的右移。用个数组记录一下字符出现个数就ok了。O(n)。 不了解two points的话,也很容易想到具有单调性,枚举左端点,二分右端点,维护一下各个字符出现的前缀和,
资源推荐
资源详情
资源评论
收起资源包目录
leetcode分类-Leetcode:leetcode (122个子文件)
The Skyline Problem.cpp 3KB
CreateMaximumNumber.cpp 2KB
Minimum Height Trees.cpp 2KB
Text Justification.cpp 2KB
Median of Two Sorted Arrays.cpp 2KB
Add and Search Word - Data structure design.cpp 2KB
Best Time to Buy and Sell Stock IV.cpp 1KB
Set Matrix Zeroes.cpp 1KB
Additive Number.cpp 1KB
Serialize and Deserialize Binary Tree.cpp 1KB
Sudoku Solver .cpp 1KB
Shortest Palindrome.cpp 1KB
Wiggle Sort II.cpp 1KB
BulbSwitcher.cpp 1KB
Maximum Gap.cpp 1KB
Find Median from Data Stream.cpp 1KB
4Sum.cpp 1KB
Burst Balloons.cpp 1KB
Maximum Product Subarray.cpp 1KB
Merge k Sorted Lists.cpp 1KB
CountofSmallerNumbersAfterSelf.cpp 1023B
Evaluate Reverse Polish Notation.cpp 1020B
Binary Search Tree Iterator.cpp 952B
Range Sum Query - Immutable.cpp 939B
Range Sum Query - Mutable.cpp 939B
Max Points on a Line.cpp 936B
Substring with Concatenation of All Words.cpp 875B
Palindrome Partitioning.cpp 816B
Range Sum Query 2D - Immutable.cpp 814B
Remove Invalid Parentheses.cpp 808B
Minimum Window Substring.cpp 803B
Sliding Window Maximum.cpp 774B
Combination Sum II .cpp 742B
Combination Sum.cpp 725B
Binary Tree Maximum Path Sum.cpp 680B
Edit Distance.cpp 677B
Best Time to Buy and Sell Stock III.cpp 667B
Missing Number.cpp 662B
Find Minimum in Rotated Sorted Array.cpp 606B
Remove Duplicate Letters.cpp 590B
Largest Number.cpp 589B
Bulls and Cows.cpp 576B
Best Time to Buy and Sell Stock with Cooldown.cpp 565B
Perfect Squares.cpp 564B
Binary Tree Postorder Traversal.cpp 553B
Sort Colors.cpp 553B
Super Ugly Number.cpp 552B
MaximumProductofWordLengths.cpp 539B
Ugly Number II.cpp 534B
Coin Change.cpp 489B
H-Index II.cpp 488B
Two Sum.cpp 462B
Anagrams.cpp 459B
Sqrt(x).cpp 456B
Longest Increasing Subsequence.cpp 448B
First Bad Version.cpp 439B
Find the Duplicate Number.cpp 418B
Move Zeroes.cpp 409B
H-Index.cpp 404B
First Missing Positive .cpp 389B
Best Time to Buy and Sell Stock II.cpp 358B
Reverse Words in a String.cpp 355B
Best Time to Buy and Sell Stock.cpp 352B
Container With Most Water .cpp 328B
Permutations II.cpp 326B
Find Peak Element.cpp 282B
Permutations.cpp 253B
Sort List.cpp 242B
Ugly Number.cpp 235B
Remove Element .cpp 233B
Next Permutation .cpp 195B
Remove Duplicates from Sorted Array .cpp 159B
Nim Game.cpp 103B
.gitattributes 483B
.gitignore 485B
Two Sum.java 515B
README.md 7KB
Regular Expression Matching.py 1003B
Spiral Matrix II.py 848B
Spiral Matrix.py 837B
Insert Interval.py 776B
Search in Rotated Sorted Array.py 774B
Longest Palindromic Substring .py 768B
Search for a Range.py 756B
Valid Sudoku.py 715B
Add Two Numbers .py 694B
Multiply Strings.py 688B
Word Pattern.py 645B
Swap Nodes in Pairs .py 641B
Merge Intervals.py 638B
String to Integer (atoi) .py 612B
Summary Ranges.py 570B
3Sum.py 557B
Longest Valid Parentheses.py 552B
Trapping Rain Water.py 534B
Valid Parentheses.py 523B
Generate Parentheses .py 515B
Remove Nth Node From End of List.py 495B
Permutation Sequence.py 485B
Search Insert Position.py 481B
共 122 条
- 1
- 2
资源评论
weixin_38650066
- 粉丝: 5
- 资源: 908
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功