没有合适的资源?快使用搜索试试~ 我知道了~
扩展矩阵leetcode-leetcode:力码练习
共88个文件
js:66个
ts:21个
md:1个
需积分: 10 0 下载量 80 浏览量
2021-07-01
03:13:27
上传
评论
收藏 59KB ZIP 举报
温馨提示
扩展矩阵leetcode leetcode 回答指南 问题 解决方案 15.给定int数组,实现threeSum(nums)以返回总和为0的所有三元组,没有重复的三元组并且没有重用元素 解决方案:排序数组然后使用两个指针的高低方法向中间“走”,使总和为 0。保存有效的三元组并更新高低指针和索引,以便我们跳过重复项。 O(n^2) 时间,O(log(n)) 空间(排序)。 49. 给定字符串数组,实现groupAnagrams(strs)将字谜合并在一起并将其作为数组返回 解决方案:实现基于字母计数的散列算法,因此字谜将返回相同的散列。 遍历字符串,获取它们的散列并将它们添加到存储在字典中的字谜组中。 返回字典的值。 O(nk) 时间其中 n 是字符串的数量,k 是最长字符串的长度,O(nk) 空间来存储字典。 53. 给定 int 数组,实现maxSubArray(nums)以从nums的连续子数组中获取最大和 解决方案:跟踪迄今为止的最大值和当前的总和。 每当总和为负时,重置总和(开始新的子数组)。 O(n) 时间,O(1) 空间。 56. 给定[start, stop]形式的区间数
资源推荐
资源详情
资源评论
收起资源包目录
leetcode-master.zip (88个子文件)
leetcode-master
51. N-Queens.js 1KB
66. Plus One.js 405B
258. Add Digits.js 205B
9. Palindrome Number.js 368B
238. Product of Array Except Self.js 3KB
283. Move Zeroes.ts 638B
28. Implement strStr().js 463B
303. Range Sum Query - Immutable.js 3KB
35. Search Insert Position.js 671B
342. Power of Four.js 363B
11. Container With Most Water.js 3KB
3. Longest Substring Without Repeating Characters.js 568B
78. Subsets.js 614B
307. Range Sum Query - Mutable.js 9KB
155. Min Stack.js 956B
796. Rotate String.js 364B
98. Validate Binary Search Tree.js 759B
970. Powerful Integers.js 613B
6. ZigZag Conversion.js 610B
415. Add Strings.ts 851B
48. Rotate Image.js 828B
412. Fizz Buzz.ts 372B
53. Maximum Subarray.js 706B
202. Happy Number.js 366B
453. Minimum Moves to Equal Array Elements.ts 650B
125. Valid Palindrome.ts 458B
242. Valid Anagram.js 3KB
19. Remove Nth Node From End of List.js 779B
46. Permutations.js 811B
680. Valid Palindrome II.ts 640B
142. Linked List Cycle II.js 814B
231. Power of Two.js 214B
1. Two Sum.js 399B
21. Merge Two Sorted Lists.ts 798B
234. Palindrome Linked List.js 783B
88. Merge Sorted Array.js 4KB
338. Counting Bits.js 394B
83. Remove Duplicates from Sorted List.js 480B
26. Remove Duplicates from Sorted Array.ts 1KB
39. Combination Sum.js 926B
49. Group Anagrams.js 4KB
136. Single Number.js 210B
100. Same Tree.js 1KB
38. Count and Say.js 724B
371. Sum of Two Integers.js 338B
20. Valid Parentheses.js 803B
47. Permutations II.js 937B
876. Middle of the Linked List.js 468B
152. Maximum Product Subarray.js 5KB
445. Add Two Numbers II.js 1KB
2. Add Two Numbers.js 815B
86. Partition List.js 798B
17. Letter Combinations of a Phone Num.js 936B
90. Subsets II.js 742B
13. Roman to Integer.js 548B
121. Best Time to Buy and Sell Stock.js 1KB
387. First Unique Character in a String.ts 414B
15. 3Sum.js 6KB
811. Subdomain Visit Count.ts 803B
7. Reverse Integer.js 517B
110. Balanced Binary Tree.js 922B
README.md 6KB
543. Diameter of Binary Tree.ts 1KB
67. Add Binary.ts 594B
40. Combination Sum II.js 1KB
141. Linked List Cycle.js 1KB
953. Verifying an Alien Dictionary.ts 950B
56. Merge Intervals.js 3KB
73. Set Matrix Zeroes.js 1KB
206. Reverse Linked List.js 563B
347. Top K Frequent Elements.js 3KB
70. Climbing Stairs.ts 266B
696. Count Binary Substrings.ts 654B
706. Design HashMap.ts 1KB
270. Closest Binary Search Tree Value.ts 1KB
217. Contains Duplicate.js 737B
160. Intersection of Two Linked Lists.js 839B
5. Longest Palindromic Substring.js 716B
14. Longest Common Prefix.js 681B
232. Implement Queue using Stacks.js 1KB
344. Reverse String.js 260B
359. Logger Rate Limiter.ts 719B
304. Range Sum Query 2D - Immutable.js 6KB
122. Best Time to Buy and Sell Stock II.ts 571B
1086-high-five.ts 846B
937. Reorder Data in Log Files.ts 1KB
108. Convert Sorted Array to Binary Search Tree.js 835B
165. Compare Version Numbers.js 605B
共 88 条
- 1
资源评论
weixin_38725426
- 粉丝: 6
- 资源: 936
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功