leetcode 算法笔记。
程序 = 数据结构 + 算法
001-01-ksum 求符合条件的 k 个数 1. Two Sum/15. 3Sum/18. 4Sum/
003-无重复字符的最长子串 Longest Substring Without Repeating Characters
005-最长回文子串 Longest Palindromic Substring
007-整数反转 reverse integer 整数的位运算汇总
008-Regular Expression Matching 正则表达式匹配 + 42.Wildcard Matching 通配符匹配
010-删除链表的倒数第 N 个结点 Remove Nth Node From End of List 双指针
011-21.合并多个有序的链表 merge k sorted lists
012-括号生成 generate-parentheses + 20. 有效的括号 valid parentheses + 32. 最长有效括号 Longest Valid Parentheses
013-K 个一组翻转链表 Reverse Nodes in k-Group + 24. 两两交换链表中的节点 swap nodes in pairs
015-串联所有单词的子串 Substring with Concatenation of All Words
018-34. 在排序数组中查找元素的第一个和最后一个位置 Find First and Last Position of Element in Sorted Array
019-36. 有效的数独 Valid Sudoku + 37. 解数独 sudoku solver
java 如何实现 binary search 二分查找法?
sort-10-java big file sort 超大文件如何实现排序?外归并排序(External merge sort)
五大基本算法之动态规划算法 DP dynamic programming
序号 | 难题 | 解决方案 | 速度% | 内存% | 时间 | 难度 |
---|---|---|---|---|---|---|
001 | two-num-sum | java | 99.93 | 69.35 | 2020-6-9 11:24:16 | EASY |
002 | add-two-numbers | java | 100 | 44.45 | 2020-6-9 14:54:51 | EASY |
003 | longest-substring-without-repeating-characters | java | 99.78 | 84.35 | 2020-6-9 17:40:26 | EASY |
004 | median-of-two-sorted-arrays | java | 99.81 | 91.06 | 2020-6-9 20:09:57 | EASY |
005 | longest-palindromic-substring | java | 96.20 | 62.76 | 2020-6-9 23:43:38 | EASY |
006 | zigzag-conversion | java | 99.85 | 99.38 | 2020-6-10 11:01:12 | EASY |
007 | reverse-integer | java | 100 | 94.78 | 2020-6-10 13:00:59 | EASY |
008 | string-to-integer-atoi | java | 81.23 | 55.25 | 2020-6-10 16:55:11 | EASY |
009 | palindrome-number | java | 100 | 71.67 | 2020-6-10 18:15:00 | EASY |
010 | regular-expression-matching | java | 92.84 | 73.31 | 2020-6-11 14:54:29 | EASY |
011 | container-with-most-water | java | 95.28 | 38.16 | 2020-6-11 17:11:50 | EASY |
012 | integer-to-roman | java | 100 | 99.54 | 2020-6-11 17:11:50 | EASY |
013 | roman-to-integer | java | 100 | 95.16 | 2020-6-11 22:12:57 | EASY |
014 | longest-common-prefix | java | 100 | 51.74 | 2020-6-11 22:38:49 | EASY |
015 | 3num | java | 99.87 | 60 | 2020-6-12 15:34:15 | EASY |
016 | 3sum-closest | java | 100 | 85.21 | 2020-6-12 16:26:29 | EASY |
017 | letter-combinations-of-a-phone-number | java | 100 | 94.58 | 2020-6-15 11:34:35 | EASY |
018 | 4sum | java | 92.21 | 56.17 | 2020-6-15 14:49:57 | EASY |
019 | remove-nth-node-from-end-of-list | java | 100 | 30.88 | 2020-6-16 22:45:02 | EASY |
020 | valid-parentheses | java | 100 | 95.67 | 2020-6-16 22:45:02 | EASY |
021 | merge-two-sorted-lists | java | 100 | 88.76 | 2020-6-17 14:03:02 | EASY |
022 | generate-parentheses | java | 100 | 63.29 | 2020-6-17 17:25:18 | EASY |
023 | merge-k-sorted-lists | java | 100 | 35.98 | 2020-6-23 23:00:47 | EASY |
024 | swap-nodes-in-pairs | java | 100 | 71.71 | 2020-6-24 13:37:18 | EASY |
025 | reverse-nodes-in-k-group | java | 100 | 28.23 | 2020-6-24 17:25:24 | EASY |
026 | remove-duplicates-from-sorted-array | java | 100 | 59.78 | 2020-6-28 22:27:49 | EASY |
027 | remove-element | java | 100 | 42.61 | 2020-6-28 22:27:49 | EASY |
028 | implement-strstr | java | 64.82 | 45.26 | 2020-6-28 22:27:49 | EASY |
029 | divide-two-integers | java | 100 | 23.80 | 2020-6-28 22:27:49 | EASY |
030 | substring-with-concatenation-of-all-words | java | 99.96 | 57.99 | 2020-6-29 14:34:24 | EASY |
031 | next-permutation | java | 100 | 66.28 | 2021-2-26 00:19:24 | MEDIUM |
033 | search-in-rotated-sorted-array | java | 100 | 75.97 | 2021-2-26 23:27:24 | MEDIUM |
034 | find-first-and-last-position-of-element-in-sorted-array | java | 100 | 72.92 | 2021-2-27 12:26:24 | MEDIUM |
036 | valid-sudoku | java | 100 | 87.00 | 2021-2-27 12:26:24 | MEDIUM |
038 | count-and-say | java | 100 | 99.63 | 2021-2-27 12:26:24 | MEDIUM |
039 | combine-sum | java | 99 | 92.84 | 2021-2-28 12:26:24 | MEDIUM |
040 | combine-sum-ii | java | 99 | 96.64 | 2021-2-28 12:26:24 | MEDIUM |
043 | multiply-strings | java | 100 | 74.17 | 2021-2-28 18:01:24 | MEDIUM |
044 | wildcard-matching | java | 100 | 74.17 | 2021-2-28 18:01:24 | MEDIUM |
045 | jump-game-ii | java | 100 | 74.17 | 2021-2-28 18:01:24 | MEDIUM |
046 | permutations | java | 93.75 | 59.41 | 2021-2-28 18:40:24 | MEDIUM |
047 | permutations-ii | java | 99.37 | 94.21 | 2021-2-28 19:15:24 | MEDIUM |
048 | rotate-image | java | 100 | 94.21 | 2021-2-28 21:15:24 | MEDIUM |
049 | group-anagrams | java | 99.74 | 42.56 | 2021-2-28 22:15:24 | MEDIUM |
050 | powerx-n | java | 100 | 46.64 | 2021-2-28 23:05:24 | MEDIUM |
054 | spiral-matrix | java | 100 | 88.28 | 2021-03-01 22:05:24 | MEDIUM |
055 | jump-game | java | 86.66 | 52.22 | 2021-03-01 22:58:24 | MEDIUM |
056 | merge-intervals | java | 97.75 | 35.99 | 2021-03-02 21:08:24 | MEDIUM |
057 | insert-intervals | java | 100 | 93.68 | 2021-03-02 22:08:24 | MEDIUM |
059 | spiral-matrix-ii | java | 100 | 81.11 | 2021-03-02 22:30:24 | MEDIUM |
061 | rotate-list | java | 100 | 87.66 | 2021-03-02 21:34:24 | MEDIUM |
062 | unique-paths | java | 100 | 87.66 | 2021-03-03 21:00:24 | MEDIUM |
063 | unique-paths-ii | java | 100 | 87.66 | 2021-03-03 21:34:24 | MEDIUM |
064 | minimum-path-sum | java | 96 | 87.66 | 2021-03-03 21:34:24 | MEDIUM |
070 | climbing-stairs | java | 100 | 91.67 | 2021-03-08 23:34:24 | EASY |
071 | simplify-path | java | 94.5 | 87.66 | 2021-03-04 21:34:24 | MEDIUM |
073 | set-matrix-zeroes | java | 96 | 87.66 | 2021-03-04 22:18:24 | MEDIUM |
074 | search-a-2d-matrix | java | 100 | 73.35 | 2021-03-07 13:03:24 | MEDIUM |
075 | sort-colors | java | 100 | 45.23 | 2021-03-07 13:50:24 | MEDIUM |
077 | combinations | java | 92.65 | 95.25 | 2021-03-04 23:18:24 | MEDIUM |
078 | subsets | java | 100 | 95.25 | 2021-03-07 14:20:24 | MEDIUM |
079 | word-search | java | 10.76 | 95.25 | 2021-03-07 18:20:24 | MEDIUM |
080 | remove-duplicates-from-sorted-array-ii | java | 100 | 95.25 | 2021-03-07 19:20:24 | MEDIUM |
081 | search-in-rotated-sorted-array-ii | java | 100 | 95.25 | 2021-03-07 20:20:24 | MEDIUM |
082 | remove-duplicates-from-sorted-list-ii | java | 100 | 95.25 | 2021-03-07 21:20:24 | MEDIUM |
086 | partition-list | java | 100 | 89.24 | 2021-03-07 22:08:24 | MEDIUM |
089 | grey-code | java | 75.5 | 89.24 | 2021-03-07 22:38:24 | MEDIUM |
090 | subsets-ii | java | 99.49 | 93.43 | 2021-03-07 14:27:24 | MEDIUM |
091 | decode-ways | java | 100 | 93.43 | 2021-03-08 23:27:24 | MEDIUM |
092 | reverse-linked-list-ii | java | 100 | 28.17 | 2021-03-09 22:27:24 | MEDIUM |
093 | restore-ip-addresses | java | 98.71 | 95.13 | 2021-03-09 23:27:24 | MEDIUM |
094 | binary-tree-inorder-traversal | java | 100 | 88.15 | 2021-03-10 23:27:24 | MEDIUM |
095 | unique-binary-search-trees-ii | java | 93.81 | 88.47 | 2021-03-10 23:27:24 | MEDIUM |
096 | unique-binary-search-trees | java | 100 | 90.45 | 2021-03-10 23:27:24 | MEDIUM |
098 | validate-binary-search-tree | java | 100 | 44.59 | 2021-03-10 23:27:24 | MEDIUM |
099 | recover-binary-search-tree | java | 99.96 | 64.64 | 2023-01-03 15:00:24 | MEDIUM |
100 | same-tree | java | 100 | 44.66 | 2023-01-03 15:27:24 | EASY |