From 5f01ba8810f05b19260a0728d05720565dc2e28a Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Thu, 23 Jun 2022 12:19:02 +0800 Subject: [PATCH 01/53] update: 94 --- README.md | 284 ++++++++++++----------- src/binary-tree-inorder-traversal/res.ts | 65 ++++++ 2 files changed, 208 insertions(+), 141 deletions(-) create mode 100644 src/binary-tree-inorder-traversal/res.ts diff --git a/README.md b/README.md index f7ee8a1..29b7a6c 100644 --- a/README.md +++ b/README.md @@ -6,144 +6,146 @@ This is the solutions collection of my LeetCode submissions, most of them are pr **Progress: 127 Solutions** -| ID | Title | Solution | Difficulty | -|---| ----- | -------- | ---------- | -|1|[Two Sum](https://leetcode.com/problems/two-sum/) | [JavaScript](./src/two-sum/res.js)|Easy| -|2|[Add Two Numbers](https://leetcode.com/problems/add-two-numbers/) | [JavaScript](./src/add-two-numbers/res.js)|Medium| -|3|[Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | [JavaScript](./src/longest-substring-without-repeating-characters/res.js) |Medium| -|4|[Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/) | [JavaScript](./src/median-of-two-sorted-arrays/res.js) |Hard| -|5|[Longest Palindromic Substring](https://leetcode.com/problems/longest-palindromic-substring/) | [JavaScript](./src/longest-palindromic-substring/res.js) |Medium| -|6|[ZigZag Conversion](https://leetcode.com/problems/zigzag-conversion/) | [JavaScript](./src/zigzag-conversion/res.js) |Medium| -|7|[Reverse Integer](https://leetcode.com/problems/reverse-integer/) | [JavaScript](./src/reverse-integer/res.js)|Easy| -|8|[String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi/) | [JavaScript](./src/string-to-integer-atoi/res.js)|Medium| -|11|[Container With Most Water](https://leetcode.com/problems/container-with-most-water/) | [JavaScript](./src/container-with-most-water/res.js)|Medium| -|13|[Roman to Integer](https://leetcode.com/problems/roman-to-integer/) | [JavaScript](./src/roman-to-integer/res.js)|Easy| -|14|[Longest Common Prefix](https://leetcode.com/problems/longest-common-prefix/) | [JavaScript](./src/longest-common-prefix/res.js)|Easy| -|15|[3Sum](https://leetcode.com/problems/3sum/) | [JavaScript](./src/3sum/res.js) |Medium| -|16|[3Sum Closest](https://leetcode.com/problems/3sum-closest/) | [JavaScript](./src/3sum-closest/res.js) |Medium| -|17|[Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/) | [JavaScript](./src/letter-combinations-of-a-phone-number/res.js)|Medium| -|19|[Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) | [JavaScript](./src/remove-nth-node-from-end-of-list/res.js)|Medium| -|22|[Generate Parentheses](https://leetcode.com/problems/generate-parentheses/) | [JavaScript](./src/generate-parentheses/res.js)|Medium| -|26|[Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/) | [JavaScript](./src/remove-duplicates-from-sorted-array/res.js)|Easy| -|27|[Remove Element](https://leetcode.com/problems/remove-element/) | [JavaScript](./src/remove-element/res.js)|Easy| -|28|[Implement strStr()](https://leetcode.com/problems/implement-strstr/) | [JavaScript](./src/implement-strstr/res.js)|Easy| -|29|[Divide Two Integers](https://leetcode.com/problems/divide-two-integers/) | [JavaScript](./src/divide-two-integers/res.js)|Medium| -|33|[Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/) | [JavaScript](./src/search-in-rotated-sorted-array/res.js)|Medium| -|34|[Search for a Range](https://leetcode.com/problems/search-for-a-range/) | [JavaScript](./src/search-for-a-range/res.js)|Medium| -|35|[Search Insert Position](https://leetcode.com/problems/search-insert-position/) | [JavaScript](./src/search-insert-position/res.js)|Easy| -|39|[Combination Sum](https://leetcode.com/problems/combination-sum/) | [JavaScript](./src/combination-sum/res.js)|Medium| -|40|[Combination Sum II](https://leetcode.com/problems/combination-sum-ii/) | [JavaScript](./src/combination-sum-ii/res.js)|Medium| -|41|[First Missing Positive](https://leetcode.com/problems/first-missing-positive/description/) | [JavaScript](./src/first-missing-positive/res.js)|Hard| -|42|[ Trapping Rain Water](https://leetcode.com/problems/trapping-rain-water/description/) | [JavaScript](./src/trapping-rain-water/res.js)|Hard| -|43|[Multiply Strings](https://leetcode.com/problems/multiply-strings/) | [JavaScript](./src/multiply-strings/res.js)|Medium| -|45|[Jump Game II](https://leetcode.com/problems/jump-game-ii/) | [JavaScript](./src/jump-game-ii/res.js)|Hard| -|46|[Permutations](https://leetcode.com/problems/permutations/) | [JavaScript](./src/permutations/res.js)|Medium| -|48|[Rotate Image](https://leetcode.com/problems/rotate-image/) | [JavaScript](./src/rotate-image/res.js)|Medium| -|49|[Group Anagrams](https://leetcode.com/problems/anagrams/) | [JavaScript](./src/anagrams/res.js)|Medium| -|53|[Maximum Subarray](https://leetcode.com/problems/maximum-subarray/) | [JavaScript](./src/maximum-subarray/res.js)|Easy| -|54|[Spiral Matrix](https://leetcode.com/problems/spiral-matrix/) | [JavaScript](./src/spiral-matrix/res.js)|Medium| -|55|[Jump Game](https://leetcode.com/problems/jump-game/) * | [JavaScript](./src/jump-game/res.js)|Medium| -|56|[Merge Intervals](https://leetcode.com/problems/merge-intervals/) | [JavaScript](./src/merge-intervals/res.js)|Medium| -|57|[Insert Interval](https://leetcode.com/problems/insert-interval/) | [JavaScript](./src/insert-interval/res.js)|Hard| -|62|[Unique Paths](https://leetcode.com/problems/unique-paths/) | [JavaScript](./src/unique-paths/res.js)|Medium| -|63|[Unique Paths ii](https://leetcode.com/problems/unique-paths-ii/) | [JavaScript](./src/unique-paths-ii/res.js)|Medium| -|66|[Plus One](https://leetcode.com/problems/plus-one/) | [JavaScript](./src/plus-one/res.js)|Easy| -|69|[Sqrt(x)](https://leetcode.com/problems/sqrtx/) | [JavaScript](./src/sqrtx/res.js)|Easy| -|71|[Simplify Path](https://leetcode.com/problems/simplify-path/) | [JavaScript](./src/simplify-path/res.js)|Medium| -|73|[Set Matrix Zeroes](https://leetcode.com/problems/set-matrix-zeroes/) | [JavaScript](./src/set-matrix-zeroes/res.js)|Medium| -|75|[Sort Colors](https://leetcode.com/problems/sort-colors/) | [JavaScript](./src/sort-colors/res.js)|Medium| -|80|[Remove Duplicates from Sorted Array II](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/) | [JavaScript](./src/remove-duplicates-from-sorted-array-ii/res.js)|Medium| -|81|[Search in Rotated Sorted Array II](https://leetcode.com/problems/search-in-rotated-sorted-array-ii/) | [JavaScript](./src/search-in-rotated-sorted-array-ii/res.js)|Medium| -|88|[ Merge Sorted Array](https://leetcode.com/problems/merge-sorted-array/) | [JavaScript](./src/merge-sorted-array/res.js)|Medium| -|91|[Decode Ways](https://leetcode.com/problems/decode-ways/) | [JavaScript](./src/decode-ways/res.js)|Medium| -|93|[Restore IP Addresses](https://leetcode.com/problems/restore-ip-addresses/) | [JavaScript](./src/restore-ip-addresses/res.js)|Medium| -|98|[Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/) | [JavaScript](./src/validate-binary-search-tree/res.js)|Medium| -|100|[Same Tree](https://leetcode.com/problems/same-tree/) | [JavaScript](./src/same-tree/res.js)|Easy| -|101|[Symmetric Tree](https://leetcode.com/problems/symmetric-tree/) | [JavaScript](./src/symmetric-tree/res.js)|Easy| -|102|[Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/) | [JavaScript](./src/binary-tree-level-order-traversal/res.js)|Medium| -|104|[Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree/) | [JavaScript](./src/maximum-depth-of-binary-tree/res.js)|Easy| -|107|[Binary Tree Level Order Traversal II](https://leetcode.com/problems/binary-tree-level-order-traversal-ii/) | [JavaScript](./src/binary-tree-level-order-traversal-ii/res.js)|Easy| -|108|[Convert Sorted Array to Binary Search Tree](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/) | [JavaScript](./src/convert-sorted-array-to-binary-search-tree/res.js)|Easy| -|111|[Minimum Depth of Binary Tree](https://leetcode.com/problems/minimum-depth-of-binary-tree/) | [JavaScript](./src/minimum-depth-of-binary-tree/res.js)|Easy| -|120|[Triangle](https://leetcode.com/problems/triangle/) | [JavaScript](./src/triangle/res.js)|Medium| -|121|[Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) | [JavaScript](./src/best-time-to-buy-and-sell-stock/res.js)|Easy| -|122|[Best Time to Buy and Sell Stock II](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-ii/res.js)|Easy| -|123|[Best Time to Buy and Sell Stock III](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/) * | [JavaScript](./src/best-time-to-buy-and-sell-stock-iii/res.js)|Hard| -|127|[Word Ladder](https://leetcode.com/problems/word-ladder/) | [JavaScript](./src/word-ladder/res.js)|Medium| -|128|[Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence/) | [JavaScript](./src/longest-consecutive-sequence/res.js)|Medium| -|130|[Surrounded Regions](https://leetcode.com/problems/surrounded-regions/) | [JavaScript](./src/surrounded-regions/res.js)|Medium| -|133|[Clone Graph](https://leetcode.com/problems/clone-graph/) | [JavaScript](./src/clone-graph/res.js)|Medium| -|134|[Gas Station](https://leetcode.com/problems/gas-station/) | [JavaScript](./src/gas-station/res.js)|Medium| -|135|[Candy](https://leetcode.com/problems/candy/) | [JavaScript](./src/candy/res.js)|Hard| -|136|[Single Number](https://leetcode.com/problems/single-number/) | [JavaScript](./src/single-number/res.js)|Easy| -|137|[Single Number II](https://leetcode.com/problems/single-number-ii/) | [JavaScript](./src/single-number-ii/res.js)|Medium| -|151|[Reverse Words in a String](https://leetcode.com/problems/reverse-words-in-a-string/) | [JavaScript](./src/reverse-words-in-a-string/res.js)|Medium| -|152|[Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray/) | [JavaScript](./src/maximum-product-subarray/res.js)|Medium| -|153|[Find Minimum in Rotated Sorted Array](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/) | [JavaScript](./src/find-minimum-in-rotated-sorted-array/res.js)|Medium| -|154|[Find Minimum in Rotated Sorted Array II](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/) | [JavaScript](./src/find-minimum-in-rotated-sorted-array-ii/res.js)|Medium| -|162|[Find Peak Element](https://leetcode.com/problems/find-peak-element/) | [JavaScript](./src/find-peak-element/res.js)|Medium| -|164|[Maximum Gap](https://leetcode.com/problems/maximum-gap/) | [JavaScript](./src/maximum-gap/res.js)|Hard| -|165|[Compare Version Numbers](https://leetcode.com/problems/compare-version-numbers/) | [JavaScript](./src/compare-version-numbers/res.js)|Medium| -|169|[Majority Element](https://leetcode.com/problems/majority-element/) | [JavaScript](./src/majority-element/res.js)|Easy| -|175|[Combine Two Tables](https://leetcode.com/problems/combine-two-tables/)| [SQL](./src/combine-two-tables/res.txt)|Easy| -|176|[Second Highest Salary](https://leetcode.com/problems/second-highest-salary/)| [SQL](./src/second-highest-salary/res.txt)|Easy| -|177|[Nth Highest Salary](https://leetcode.com/problems/nth-highest-salary/)| [SQL](./src/nth-highest-salary/res.txt)|Medium| -|181|[Employees Earning More Than Their Managers](https://leetcode.com/problems/employees-earning-more-than-their-managers/) | [SQL](./src/employees-earning-more-than-their-managers/res.txt)|Easy| -|182|[Duplicate Emails](https://leetcode.com/problems/duplicate-emails/) | [SQL](./src/duplicate-emails/res.txt)|Easy| -|183|[Customers Who Never Order](https://leetcode.com/problems/customers-who-never-order/) | [SQL](./src/customers-who-never-order/res.txt)|Easy| -|184|[Department Highest Salary](https://leetcode.com/problems/department-highest-salary/) | [SQL](./src/department-highest-salary/res.txt)|Medium| -|188|[Best Time to Buy and Sell Stock IV](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-iv/res.txt)|Hard| -|189|[Rotate Array](https://leetcode.com/problems/rotate-array/) | [JavaScript](./src/rotate-array/res.js)|Easy| -|190|[Reverse Bits](https://leetcode.com/problems/reverse-bits/) | [JavaScript](./src/reverse-bits/res.js)|Easy| -|196|[Delete Duplicate Emails](https://leetcode.com/problems/delete-duplicate-emails/) | [SQL](./src/delete-duplicate-emails/res.txt)|Easy| -|197|[Rising Temperature](https://leetcode.com/problems/rising-temperature/) | [SQL](./src/rising-temperature/res.txt)|Easy| -|206|[Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/) | [JavaScript](./src/reverse-linked-list/res.js)|Easy| -|207|[Course Schedule](https://leetcode.com/problems/course-schedule/) | [JavaScript](./src/course-schedule/res.js)|Medium| -|209|[Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum/) | [JavaScript](./src/minimum-size-subarray-sum/res.js)|Medium| -|210|[Course Schedule II](https://leetcode.com/problems/course-schedule-ii/) | [JavaScript](./src/course-schedule-ii/res.js)|Medium| -|215|[Kth Largest Element in an Array](https://leetcode.com/problems/kth-largest-element-in-an-array/) | [JavaScript](./src/kth-largest-element-in-an-array/res.js)|Medium| -|217|[Contains Duplicate](https://leetcode.com/problems/contains-duplicate/) | [JavaScript](./src/contains-duplicate/res.js)|Easy| -|219|[Contains Duplicate II](https://leetcode.com/problems/contains-duplicate-ii/) | [JavaScript](./src/contains-duplicate-ii/res.js)|Easy| -|220|[Contains Duplicate III](https://leetcode.com/problems/contains-duplicate-iii/) | [JavaScript](./src/contains-duplicate-iii/res.js)|Medium| -|228|[Summary Ranges](https://leetcode.com/problems/summary-ranges/solution/) | [JavaScript](./src/summary-ranges/res.js)|Medium| -|238|[Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/solution/) | [JavaScript](./src/product-of-array-except-self/res.js)|Medium| -|239|[Sliding Window Maximum](https://leetcode.com/problems/sliding-window-maximum/description/) | [JavaScript](./src/sliding-window-maximum/description/res.js)|Hard| -|240|[Search a 2D Matrix II](https://leetcode.com/problems/search-a-2d-matrix-ii/) | [JavaScript](./src/search-a-2d-matrix-ii/res.js)|Medium| -|274|[H-Index](https://leetcode.com/problems/h-index/) | [JavaScript](./src/h-index/res.js)|Medium| -|275|[H-Index II](https://leetcode.com/problems/h-index-ii/) | [JavaScript](./src/h-index-ii/res.js)|Medium| -|278|[First Bad Version](https://leetcode.com/problems/first-bad-version/) | [JavaScript](./src/first-bad-version/res.js)|Easy| -|283|[Move Zeroes](https://leetcode.com/problems/move-zeroes/) | [JavaScript](./src/move-zeroes/res.js)|Easy| -|287|[Find the Duplicate Number](https://leetcode.com/problems/find-the-duplicate-number/) | [JavaScript](./src/find-the-duplicate-number/res.js)|Medium| -|289|[Game of Life](https://leetcode.com/problems/game-of-life/) | [JavaScript](./src/game-of-life/res.js)|Medium| -|295|[Find Median from Data Stream](https://leetcode.com/problems/find-median-from-data-stream/) | [JavaScript](./src/find-median-from-data-stream/res.js)|Hard| -|299|[Bulls and Cows](https://leetcode.com/problems/bulls-and-cows/) | [JavaScript](./src/bulls-and-cows/res.js)|Medium| -|300|[Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence/) | [JavaScript](./src/longest-increasing-subsequence/res.js)|Medium| -|307|[Range Sum Query - Mutable](https://leetcode.com/problems/range-sum-query-mutable/) | [JavaScript](./src/range-sum-query-mutable/res.js)|Medium| -|309|[Best Time to Buy and Sell Stock with Cooldown](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-with-cooldown/res.js)|Medium| -|310|[Minimum Height Trees](https://leetcode.com/problems/minimum-height-trees/) | [JavaScript](./src/minimum-height-trees/res.js)|Medium| -|315|[Count of Smaller Numbers After Self](https://leetcode.com/problems/count-of-smaller-numbers-after-self/) * | [JavaScript](./src/count-of-smaller-numbers-after-self/res.js)|Hard| -|322|[Coin Change](https://leetcode.com/problems/coin-change/) | [JavaScript](./src/coin-change/res.js)|Medium| -|327|[Count of Range Sum](https://leetcode.com/problems/count-of-range-sum/) | [JavaScript](./src/count-of-range-sum/res.js)|Hard| -|334|[Increasing Triplet Subsequence](https://leetcode.com/problems/increasing-triplet-subsequence/) | [JavaScript](./src/increasing-triplet-subsequence/res.js)|Medium| -|340|[Longest Substring with At Most K Distinct Characters](https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters/) | [JavaScript](./src/longest-substring-with-at-most-k-distinct-characters/res.js)|Hard| -|342|[Power of Four](https://leetcode.com/problems/power-of-four/) | [JavaScript](./src/power-of-four/res.js)|Easy| -|344|[Reverse String](https://leetcode.com/problems/reverse-string/) | [JavaScript](./src/reverse-string/res.js)|Easy| -|349|[Intersection of Two Arrays](https://leetcode.com/problems/intersection-of-two-arrays/) | [JavaScript](./src/intersection-of-two-arrays/res.js)|Easy| -|350|[Intersection of Two Arrays ii](https://leetcode.com/problems/intersection-of-two-arrays-ii/) | [JavaScript](./src/intersection-of-two-arrays-ii/res.js)|Easy| -|371|[Sum of Two Integers](https://leetcode.com/problems/sum-of-two-integers/) | [JavaScript](./src/sum-of-two-integers/res.js)|Easy| -|374|[Guess Number Higher or Lower](https://leetcode.com/problems/guess-number-higher-or-lower/) | [JavaScript](./src/guess-number-higher-or-lower/res.py)|Easy| -|376|[Wiggle Subsequence](https://leetcode.com/problems/wiggle-subsequence/) | [JavaScript](./src/wiggle-subsequence/res.js)|Medium| -|384|[Shuffle an Array](https://leetcode.com/problems/shuffle-an-array/) | [JavaScript](./src/shuffle-an-array/res.js)|Medium| -|395|[Longest Substring with At Least K Repeating Characters](https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters/) | [JavaScript](./src/longest-substring-with-at-least-k-repeating-characters/res.js)|Medium| -|404|[Sum of Left Leaves](https://leetcode.com/problems/sum-of-left-leaves/) | [JavaScript](./src/sum-of-left-leaves/res.js)|Easy| -|413|[Arithmetic Slices](https://leetcode.com/problems/arithmetic-slices/) | [JavaScript](./src/arithmetic-slices/res.js)|Medium| -|416|[Partition Equal Subset Sum](https://leetcode.com/problems/partition-equal-subset-sum/) | [JavaScript](./src/partition-equal-subset-sum/res.js)|Medium| -|424|[Longest Repeating Character Replacement](https://leetcode.com/problems/longest-repeating-character-replacement/) | [JavaScript](./src/longest-repeating-character-replacement/res.js)|Medium| -|434|[Number of Segments in a String](https://leetcode.com/problems/number-of-segments-in-a-string/) | [JavaScript](./src/number-of-segments-in-a-string/res.js)|Easy| -|486|[Predict the Winner](https://leetcode.com/problems/predict-the-winner/) | [JavaScript](./src/predict-the-winner/res.js)|Medium| -|494|[Target Sum](https://leetcode.com/problems/target-sum/) | [JavaScript](./src/target-sum/res.js)|Medium| -|516|[Longest Palindromic Subsequence](https://leetcode.com/problems/longest-palindromic-subsequence/) | [JavaScript](./src/longest-palindromic-subsequence/res.js)|Medium| -|523|[Continuous Subarray Sum](https://leetcode.com/problems/continuous-subarray-sum/) | [JavaScript](./src/continuous-subarray-sum/res.js)|Medium| -|539|[Minimum Time Difference](https://leetcode.com/problems/minimum-time-difference/) | [JavaScript](./src/minimum-time-difference/res.js)|Medium| -|687|[Longest Univalue Path](https://leetcode.com/problems/longest-univalue-path/) | [JavaScript](./src/longest-univalue-path/res.js)|Easy| -|779|[K-th Symbol in Grammar](https://leetcode.com/problems/k-th-symbol-in-grammar/) | [JavaScript](./src/k-th-symbol-in-grammar/res.js)|Medium| +| ID | Title | Solution | Difficulty | +|-----|-------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|------------| +| 1 | [Two Sum](https://leetcode.com/problems/two-sum/) | [JavaScript](./src/two-sum/res.js) | Easy | +| 2 | [Add Two Numbers](https://leetcode.com/problems/add-two-numbers/) | [JavaScript](./src/add-two-numbers/res.js) | Medium | +| 3 | [Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | [JavaScript](./src/longest-substring-without-repeating-characters/res.js) | Medium | +| 4 | [Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/) | [JavaScript](./src/median-of-two-sorted-arrays/res.js) | Hard | +| 5 | [Longest Palindromic Substring](https://leetcode.com/problems/longest-palindromic-substring/) | [JavaScript](./src/longest-palindromic-substring/res.js) | Medium | +| 6 | [ZigZag Conversion](https://leetcode.com/problems/zigzag-conversion/) | [JavaScript](./src/zigzag-conversion/res.js) | Medium | +| 7 | [Reverse Integer](https://leetcode.com/problems/reverse-integer/) | [JavaScript](./src/reverse-integer/res.js) | Easy | +| 8 | [String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi/) | [JavaScript](./src/string-to-integer-atoi/res.js) | Medium | +| 11 | [Container With Most Water](https://leetcode.com/problems/container-with-most-water/) | [JavaScript](./src/container-with-most-water/res.js) | Medium | +| 13 | [Roman to Integer](https://leetcode.com/problems/roman-to-integer/) | [JavaScript](./src/roman-to-integer/res.js) | Easy | +| 14 | [Longest Common Prefix](https://leetcode.com/problems/longest-common-prefix/) | [JavaScript](./src/longest-common-prefix/res.js) | Easy | +| 15 | [3Sum](https://leetcode.com/problems/3sum/) | [JavaScript](./src/3sum/res.js) | Medium | +| 16 | [3Sum Closest](https://leetcode.com/problems/3sum-closest/) | [JavaScript](./src/3sum-closest/res.js) | Medium | +| 17 | [Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/) | [JavaScript](./src/letter-combinations-of-a-phone-number/res.js) | Medium | +| 19 | [Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) | [JavaScript](./src/remove-nth-node-from-end-of-list/res.js) | Medium | +| 22 | [Generate Parentheses](https://leetcode.com/problems/generate-parentheses/) | [JavaScript](./src/generate-parentheses/res.js) | Medium | +| 26 | [Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/) | [JavaScript](./src/remove-duplicates-from-sorted-array/res.js) | Easy | +| 27 | [Remove Element](https://leetcode.com/problems/remove-element/) | [JavaScript](./src/remove-element/res.js) | Easy | +| 28 | [Implement strStr()](https://leetcode.com/problems/implement-strstr/) | [JavaScript](./src/implement-strstr/res.js) | Easy | +| 29 | [Divide Two Integers](https://leetcode.com/problems/divide-two-integers/) | [JavaScript](./src/divide-two-integers/res.js) | Medium | +| 33 | [Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/) | [JavaScript](./src/search-in-rotated-sorted-array/res.js) | Medium | +| 34 | [Search for a Range](https://leetcode.com/problems/search-for-a-range/) | [JavaScript](./src/search-for-a-range/res.js) | Medium | +| 35 | [Search Insert Position](https://leetcode.com/problems/search-insert-position/) | [JavaScript](./src/search-insert-position/res.js) | Easy | +| 39 | [Combination Sum](https://leetcode.com/problems/combination-sum/) | [JavaScript](./src/combination-sum/res.js) | Medium | +| 40 | [Combination Sum II](https://leetcode.com/problems/combination-sum-ii/) | [JavaScript](./src/combination-sum-ii/res.js) | Medium | +| 41 | [First Missing Positive](https://leetcode.com/problems/first-missing-positive/description/) | [JavaScript](./src/first-missing-positive/res.js) | Hard | +| 42 | [ Trapping Rain Water](https://leetcode.com/problems/trapping-rain-water/description/) | [JavaScript](./src/trapping-rain-water/res.js) | Hard | +| 43 | [Multiply Strings](https://leetcode.com/problems/multiply-strings/) | [JavaScript](./src/multiply-strings/res.js) | Medium | +| 45 | [Jump Game II](https://leetcode.com/problems/jump-game-ii/) | [JavaScript](./src/jump-game-ii/res.js) | Hard | +| 46 | [Permutations](https://leetcode.com/problems/permutations/) | [JavaScript](./src/permutations/res.js) | Medium | +| 48 | [Rotate Image](https://leetcode.com/problems/rotate-image/) | [JavaScript](./src/rotate-image/res.js) | Medium | +| 49 | [Group Anagrams](https://leetcode.com/problems/anagrams/) | [JavaScript](./src/anagrams/res.js) | Medium | +| 53 | [Maximum Subarray](https://leetcode.com/problems/maximum-subarray/) | [JavaScript](./src/maximum-subarray/res.js) | Easy | +| 54 | [Spiral Matrix](https://leetcode.com/problems/spiral-matrix/) | [JavaScript](./src/spiral-matrix/res.js) | Medium | +| 55 | [Jump Game](https://leetcode.com/problems/jump-game/) * | [JavaScript](./src/jump-game/res.js) | Medium | +| 56 | [Merge Intervals](https://leetcode.com/problems/merge-intervals/) | [JavaScript](./src/merge-intervals/res.js) | Medium | +| 57 | [Insert Interval](https://leetcode.com/problems/insert-interval/) | [JavaScript](./src/insert-interval/res.js) | Hard | +| 62 | [Unique Paths](https://leetcode.com/problems/unique-paths/) | [JavaScript](./src/unique-paths/res.js) | Medium | +| 63 | [Unique Paths ii](https://leetcode.com/problems/unique-paths-ii/) | [JavaScript](./src/unique-paths-ii/res.js) | Medium | +| 66 | [Plus One](https://leetcode.com/problems/plus-one/) | [JavaScript](./src/plus-one/res.js) | Easy | +| 69 | [Sqrt(x)](https://leetcode.com/problems/sqrtx/) | [JavaScript](./src/sqrtx/res.js) | Easy | +| 71 | [Simplify Path](https://leetcode.com/problems/simplify-path/) | [JavaScript](./src/simplify-path/res.js) | Medium | +| 73 | [Set Matrix Zeroes](https://leetcode.com/problems/set-matrix-zeroes/) | [JavaScript](./src/set-matrix-zeroes/res.js) | Medium | +| 75 | [Sort Colors](https://leetcode.com/problems/sort-colors/) | [JavaScript](./src/sort-colors/res.js) | Medium | +| 80 | [Remove Duplicates from Sorted Array II](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/) | [JavaScript](./src/remove-duplicates-from-sorted-array-ii/res.js) | Medium | +| 81 | [Search in Rotated Sorted Array II](https://leetcode.com/problems/search-in-rotated-sorted-array-ii/) | [JavaScript](./src/search-in-rotated-sorted-array-ii/res.js) | Medium | +| 88 | [ Merge Sorted Array](https://leetcode.com/problems/merge-sorted-array/) | [JavaScript](./src/merge-sorted-array/res.js) | Medium | +| 91 | [Decode Ways](https://leetcode.com/problems/decode-ways/) | [JavaScript](./src/decode-ways/res.js) | Medium | +| 93 | [Restore IP Addresses](https://leetcode.com/problems/restore-ip-addresses/) | [JavaScript](./src/restore-ip-addresses/res.js) | Medium | +| 94 | [Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal/) | [TypeScript](./src/binary-tree-inorder-traversal/res.ts) | Easy | +| 98 | [Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/) | [JavaScript](./src/validate-binary-search-tree/res.js) | Medium | +| 100 | [Same Tree](https://leetcode.com/problems/same-tree/) | [JavaScript](./src/same-tree/res.js) | Easy | +| 101 | [Symmetric Tree](https://leetcode.com/problems/symmetric-tree/) | [JavaScript](./src/symmetric-tree/res.js) | Easy | +| 102 | [Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/) | [JavaScript](./src/binary-tree-level-order-traversal/res.js) | Medium | +| 104 | [Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree/) | [JavaScript](./src/maximum-depth-of-binary-tree/res.js) | Easy | +| 107 | [Binary Tree Level Order Traversal II](https://leetcode.com/problems/binary-tree-level-order-traversal-ii/) | [JavaScript](./src/binary-tree-level-order-traversal-ii/res.js) | Easy | +| 108 | [Convert Sorted Array to Binary Search Tree](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/) | [JavaScript](./src/convert-sorted-array-to-binary-search-tree/res.js) | Easy | +| 111 | [Minimum Depth of Binary Tree](https://leetcode.com/problems/minimum-depth-of-binary-tree/) | [JavaScript](./src/minimum-depth-of-binary-tree/res.js) | Easy | +| 120 | [Triangle](https://leetcode.com/problems/triangle/) | [JavaScript](./src/triangle/res.js) | Medium | +| 121 | [Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) | [JavaScript](./src/best-time-to-buy-and-sell-stock/res.js) | Easy | +| 122 | [Best Time to Buy and Sell Stock II](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-ii/res.js) | Easy | +| 123 | [Best Time to Buy and Sell Stock III](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/) * | [JavaScript](./src/best-time-to-buy-and-sell-stock-iii/res.js) | Hard | +| 127 | [Word Ladder](https://leetcode.com/problems/word-ladder/) | [JavaScript](./src/word-ladder/res.js) | Medium | +| 128 | [Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence/) | [JavaScript](./src/longest-consecutive-sequence/res.js) | Medium | +| 130 | [Surrounded Regions](https://leetcode.com/problems/surrounded-regions/) | [JavaScript](./src/surrounded-regions/res.js) | Medium | +| 133 | [Clone Graph](https://leetcode.com/problems/clone-graph/) | [JavaScript](./src/clone-graph/res.js) | Medium | +| 134 | [Gas Station](https://leetcode.com/problems/gas-station/) | [JavaScript](./src/gas-station/res.js) | Medium | +| 135 | [Candy](https://leetcode.com/problems/candy/) | [JavaScript](./src/candy/res.js) | Hard | +| 136 | [Single Number](https://leetcode.com/problems/single-number/) | [JavaScript](./src/single-number/res.js) | Easy | +| 137 | [Single Number II](https://leetcode.com/problems/single-number-ii/) | [JavaScript](./src/single-number-ii/res.js) | Medium | +| 151 | [Reverse Words in a String](https://leetcode.com/problems/reverse-words-in-a-string/) | [JavaScript](./src/reverse-words-in-a-string/res.js) | Medium | +| 152 | [Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray/) | [JavaScript](./src/maximum-product-subarray/res.js) | Medium | +| 153 | [Find Minimum in Rotated Sorted Array](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/) | [JavaScript](./src/find-minimum-in-rotated-sorted-array/res.js) | Medium | +| 154 | [Find Minimum in Rotated Sorted Array II](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/) | [JavaScript](./src/find-minimum-in-rotated-sorted-array-ii/res.js) | Medium | +| 162 | [Find Peak Element](https://leetcode.com/problems/find-peak-element/) | [JavaScript](./src/find-peak-element/res.js) | Medium | +| 164 | [Maximum Gap](https://leetcode.com/problems/maximum-gap/) | [JavaScript](./src/maximum-gap/res.js) | Hard | +| 165 | [Compare Version Numbers](https://leetcode.com/problems/compare-version-numbers/) | [JavaScript](./src/compare-version-numbers/res.js) | Medium | +| 169 | [Majority Element](https://leetcode.com/problems/majority-element/) | [JavaScript](./src/majority-element/res.js) | Easy | +| 175 | [Combine Two Tables](https://leetcode.com/problems/combine-two-tables/) | [SQL](./src/combine-two-tables/res.txt) | Easy | +| 176 | [Second Highest Salary](https://leetcode.com/problems/second-highest-salary/) | [SQL](./src/second-highest-salary/res.txt) | Easy | +| 177 | [Nth Highest Salary](https://leetcode.com/problems/nth-highest-salary/) | [SQL](./src/nth-highest-salary/res.txt) | Medium | +| 181 | [Employees Earning More Than Their Managers](https://leetcode.com/problems/employees-earning-more-than-their-managers/) | [SQL](./src/employees-earning-more-than-their-managers/res.txt) | Easy | +| 182 | [Duplicate Emails](https://leetcode.com/problems/duplicate-emails/) | [SQL](./src/duplicate-emails/res.txt) | Easy | +| 183 | [Customers Who Never Order](https://leetcode.com/problems/customers-who-never-order/) | [SQL](./src/customers-who-never-order/res.txt) | Easy | +| 184 | [Department Highest Salary](https://leetcode.com/problems/department-highest-salary/) | [SQL](./src/department-highest-salary/res.txt) | Medium | +| 188 | [Best Time to Buy and Sell Stock IV](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-iv/res.txt) | Hard | +| 189 | [Rotate Array](https://leetcode.com/problems/rotate-array/) | [JavaScript](./src/rotate-array/res.js) | Easy | +| 190 | [Reverse Bits](https://leetcode.com/problems/reverse-bits/) | [JavaScript](./src/reverse-bits/res.js) | Easy | +| 196 | [Delete Duplicate Emails](https://leetcode.com/problems/delete-duplicate-emails/) | [SQL](./src/delete-duplicate-emails/res.txt) | Easy | +| 197 | [Rising Temperature](https://leetcode.com/problems/rising-temperature/) | [SQL](./src/rising-temperature/res.txt) | Easy | +| 206 | [Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/) | [JavaScript](./src/reverse-linked-list/res.js) | Easy | +| 207 | [Course Schedule](https://leetcode.com/problems/course-schedule/) | [JavaScript](./src/course-schedule/res.js) | Medium | +| 209 | [Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum/) | [JavaScript](./src/minimum-size-subarray-sum/res.js) | Medium | +| 210 | [Course Schedule II](https://leetcode.com/problems/course-schedule-ii/) | [JavaScript](./src/course-schedule-ii/res.js) | Medium | +| 215 | [Kth Largest Element in an Array](https://leetcode.com/problems/kth-largest-element-in-an-array/) | [JavaScript](./src/kth-largest-element-in-an-array/res.js) | Medium | +| 217 | [Contains Duplicate](https://leetcode.com/problems/contains-duplicate/) | [JavaScript](./src/contains-duplicate/res.js) | Easy | +| 219 | [Contains Duplicate II](https://leetcode.com/problems/contains-duplicate-ii/) | [JavaScript](./src/contains-duplicate-ii/res.js) | Easy | +| 220 | [Contains Duplicate III](https://leetcode.com/problems/contains-duplicate-iii/) | [JavaScript](./src/contains-duplicate-iii/res.js) | Medium | +| 228 | [Summary Ranges](https://leetcode.com/problems/summary-ranges/solution/) | [JavaScript](./src/summary-ranges/res.js) | Medium | +| 238 | [Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/solution/) | [JavaScript](./src/product-of-array-except-self/res.js) | Medium | +| 239 | [Sliding Window Maximum](https://leetcode.com/problems/sliding-window-maximum/description/) | [JavaScript](./src/sliding-window-maximum/description/res.js) | Hard | +| 240 | [Search a 2D Matrix II](https://leetcode.com/problems/search-a-2d-matrix-ii/) | [JavaScript](./src/search-a-2d-matrix-ii/res.js) | Medium | +| 274 | [H-Index](https://leetcode.com/problems/h-index/) | [JavaScript](./src/h-index/res.js) | Medium | +| 275 | [H-Index II](https://leetcode.com/problems/h-index-ii/) | [JavaScript](./src/h-index-ii/res.js) | Medium | +| 278 | [First Bad Version](https://leetcode.com/problems/first-bad-version/) | [JavaScript](./src/first-bad-version/res.js) | Easy | +| 283 | [Move Zeroes](https://leetcode.com/problems/move-zeroes/) | [JavaScript](./src/move-zeroes/res.js) | Easy | +| 287 | [Find the Duplicate Number](https://leetcode.com/problems/find-the-duplicate-number/) | [JavaScript](./src/find-the-duplicate-number/res.js) | Medium | +| 289 | [Game of Life](https://leetcode.com/problems/game-of-life/) | [JavaScript](./src/game-of-life/res.js) | Medium | +| 295 | [Find Median from Data Stream](https://leetcode.com/problems/find-median-from-data-stream/) | [JavaScript](./src/find-median-from-data-stream/res.js) | Hard | +| 299 | [Bulls and Cows](https://leetcode.com/problems/bulls-and-cows/) | [JavaScript](./src/bulls-and-cows/res.js) | Medium | +| 300 | [Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence/) | [JavaScript](./src/longest-increasing-subsequence/res.js) | Medium | +| 307 | [Range Sum Query - Mutable](https://leetcode.com/problems/range-sum-query-mutable/) | [JavaScript](./src/range-sum-query-mutable/res.js) | Medium | +| 309 | [Best Time to Buy and Sell Stock with Cooldown](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-with-cooldown/res.js) | Medium | +| 310 | [Minimum Height Trees](https://leetcode.com/problems/minimum-height-trees/) | [JavaScript](./src/minimum-height-trees/res.js) | Medium | +| 315 | [Count of Smaller Numbers After Self](https://leetcode.com/problems/count-of-smaller-numbers-after-self/) * | [JavaScript](./src/count-of-smaller-numbers-after-self/res.js) | Hard | +| 322 | [Coin Change](https://leetcode.com/problems/coin-change/) | [JavaScript](./src/coin-change/res.js) | Medium | +| 327 | [Count of Range Sum](https://leetcode.com/problems/count-of-range-sum/) | [JavaScript](./src/count-of-range-sum/res.js) | Hard | +| 334 | [Increasing Triplet Subsequence](https://leetcode.com/problems/increasing-triplet-subsequence/) | [JavaScript](./src/increasing-triplet-subsequence/res.js) | Medium | +| 340 | [Longest Substring with At Most K Distinct Characters](https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters/) | [JavaScript](./src/longest-substring-with-at-most-k-distinct-characters/res.js) | Hard | +| 342 | [Power of Four](https://leetcode.com/problems/power-of-four/) | [JavaScript](./src/power-of-four/res.js) | Easy | +| 344 | [Reverse String](https://leetcode.com/problems/reverse-string/) | [JavaScript](./src/reverse-string/res.js) | Easy | +| 349 | [Intersection of Two Arrays](https://leetcode.com/problems/intersection-of-two-arrays/) | [JavaScript](./src/intersection-of-two-arrays/res.js) | Easy | +| 350 | [Intersection of Two Arrays ii](https://leetcode.com/problems/intersection-of-two-arrays-ii/) | [JavaScript](./src/intersection-of-two-arrays-ii/res.js) | Easy | +| 371 | [Sum of Two Integers](https://leetcode.com/problems/sum-of-two-integers/) | [JavaScript](./src/sum-of-two-integers/res.js) | Easy | +| 374 | [Guess Number Higher or Lower](https://leetcode.com/problems/guess-number-higher-or-lower/) | [JavaScript](./src/guess-number-higher-or-lower/res.py) | Easy | +| 376 | [Wiggle Subsequence](https://leetcode.com/problems/wiggle-subsequence/) | [JavaScript](./src/wiggle-subsequence/res.js) | Medium | +| 384 | [Shuffle an Array](https://leetcode.com/problems/shuffle-an-array/) | [JavaScript](./src/shuffle-an-array/res.js) | Medium | +| 395 | [Longest Substring with At Least K Repeating Characters](https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters/) | [JavaScript](./src/longest-substring-with-at-least-k-repeating-characters/res.js) | Medium | +| 404 | [Sum of Left Leaves](https://leetcode.com/problems/sum-of-left-leaves/) | [JavaScript](./src/sum-of-left-leaves/res.js) | Easy | +| 413 | [Arithmetic Slices](https://leetcode.com/problems/arithmetic-slices/) | [JavaScript](./src/arithmetic-slices/res.js) | Medium | +| 416 | [Partition Equal Subset Sum](https://leetcode.com/problems/partition-equal-subset-sum/) | [JavaScript](./src/partition-equal-subset-sum/res.js) | Medium | +| 424 | [Longest Repeating Character Replacement](https://leetcode.com/problems/longest-repeating-character-replacement/) | [JavaScript](./src/longest-repeating-character-replacement/res.js) | Medium | +| 434 | [Number of Segments in a String](https://leetcode.com/problems/number-of-segments-in-a-string/) | [JavaScript](./src/number-of-segments-in-a-string/res.js) | Easy | +| 486 | [Predict the Winner](https://leetcode.com/problems/predict-the-winner/) | [JavaScript](./src/predict-the-winner/res.js) | Medium | +| 494 | [Target Sum](https://leetcode.com/problems/target-sum/) | [JavaScript](./src/target-sum/res.js) | Medium | +| 516 | [Longest Palindromic Subsequence](https://leetcode.com/problems/longest-palindromic-subsequence/) | [JavaScript](./src/longest-palindromic-subsequence/res.js) | Medium | +| 523 | [Continuous Subarray Sum](https://leetcode.com/problems/continuous-subarray-sum/) | [JavaScript](./src/continuous-subarray-sum/res.js) | Medium | +| 539 | [Minimum Time Difference](https://leetcode.com/problems/minimum-time-difference/) | [JavaScript](./src/minimum-time-difference/res.js) | Medium | +| 687 | [Longest Univalue Path](https://leetcode.com/problems/longest-univalue-path/) | [JavaScript](./src/longest-univalue-path/res.js) | Easy | +| 779 | [K-th Symbol in Grammar](https://leetcode.com/problems/k-th-symbol-in-grammar/) | [JavaScript](./src/k-th-symbol-in-grammar/res.js) | Medium | +| NO | [NAME](https://leetcode.com/problems/XXX/) | [TypeScript](./src/XXX/res.ts) | Easy | diff --git a/src/binary-tree-inorder-traversal/res.ts b/src/binary-tree-inorder-traversal/res.ts new file mode 100644 index 0000000..33f3b9a --- /dev/null +++ b/src/binary-tree-inorder-traversal/res.ts @@ -0,0 +1,65 @@ +/** + * Definition for a binary tree node. + */ +class TreeNode { + val: number + left: TreeNode | null + right: TreeNode | null + constructor(val?: number, left?: TreeNode | null, right?: TreeNode | null) { + this.val = (val===undefined ? 0 : val) + this.left = (left===undefined ? null : left) + this.right = (right===undefined ? null : right) + } +} + +/** + * 递归 + * @param root + */ +function inorderTraversal(root: TreeNode | null): number[] { + const result: number[] = []; + + if (!root) { + return result; + } + + if (root.left) { + result.push(...inorderTraversal(root.left)); + } + result.push(root.val); + if (root.right) { + result.push(...inorderTraversal(root.right)); + } + + return result; +}; + +/** + * 迭代 + * @param root + */ +function inorderTraversal2(root: TreeNode | null): number[] { + const result: number[] = []; + + if (!root) { + return result; + } + + const nodes = []; + + let currentPointer = root; + while(nodes.length || currentPointer) { + // left + while (currentPointer) { + nodes.push(currentPointer); + currentPointer = currentPointer.left; + } + const singleNode = nodes.pop(); + result.push(singleNode.val); + + // right + currentPointer = singleNode.right; + } + + return result; +}; \ No newline at end of file From a78a17b03d3c79c166fc190b69fedb6ddeeed569 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Thu, 23 Jun 2022 12:21:47 +0800 Subject: [PATCH 02/53] =?UTF-8?q?update:=20=E8=A1=A5=E9=BD=90=E7=BC=BA?= =?UTF-8?q?=E5=A4=B1=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + src/minimum-time-difference/res.js | 40 ++++++++++++++++++++++++++++++ src/predict-the-winner/res.js | 18 ++++++++++++++ 3 files changed, 59 insertions(+) create mode 100644 .gitignore create mode 100644 src/minimum-time-difference/res.js create mode 100644 src/predict-the-winner/res.js diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bc8a670 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea/* \ No newline at end of file diff --git a/src/minimum-time-difference/res.js b/src/minimum-time-difference/res.js new file mode 100644 index 0000000..6c40764 --- /dev/null +++ b/src/minimum-time-difference/res.js @@ -0,0 +1,40 @@ +/** + * @param {string[]} timePoints + * @return {number} + */ +let findMinDifference = function(timePoints) { + let len = timePoints.length; + if (len === 1) return 0; + + let tarray = new Array(24*60), + min = 1441, + max = -1, + res = 1441, + prev = 0; + + for (let i=0; i=0; i--) { + for (let j=i; j= 0; +}; + From 1d11ceae1a1bef0a66d63d01dad51c5c66ee0ab5 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Thu, 23 Jun 2022 12:53:31 +0800 Subject: [PATCH 03/53] update: 110 --- README.md | 1 + src/balanced-binary-tree/res.ts | 68 +++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 src/balanced-binary-tree/res.ts diff --git a/README.md b/README.md index 29b7a6c..121b286 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 104 | [Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree/) | [JavaScript](./src/maximum-depth-of-binary-tree/res.js) | Easy | | 107 | [Binary Tree Level Order Traversal II](https://leetcode.com/problems/binary-tree-level-order-traversal-ii/) | [JavaScript](./src/binary-tree-level-order-traversal-ii/res.js) | Easy | | 108 | [Convert Sorted Array to Binary Search Tree](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/) | [JavaScript](./src/convert-sorted-array-to-binary-search-tree/res.js) | Easy | +| 110 | [balanced-binary-tree](https://leetcode.com/problems/balanced-binary-tree/) | [TypeScript](./src/balanced-binary-tree/res.ts) | Easy | | 111 | [Minimum Depth of Binary Tree](https://leetcode.com/problems/minimum-depth-of-binary-tree/) | [JavaScript](./src/minimum-depth-of-binary-tree/res.js) | Easy | | 120 | [Triangle](https://leetcode.com/problems/triangle/) | [JavaScript](./src/triangle/res.js) | Medium | | 121 | [Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) | [JavaScript](./src/best-time-to-buy-and-sell-stock/res.js) | Easy | diff --git a/src/balanced-binary-tree/res.ts b/src/balanced-binary-tree/res.ts new file mode 100644 index 0000000..5947a83 --- /dev/null +++ b/src/balanced-binary-tree/res.ts @@ -0,0 +1,68 @@ +/** + * Definition for a binary tree node. + */ +class TreeNode { + val: number + left: TreeNode | null + right: TreeNode | null + constructor(val?: number, left?: TreeNode | null, right?: TreeNode | null) { + this.val = (val===undefined ? 0 : val) + this.left = (left===undefined ? null : left) + this.right = (right===undefined ? null : right) + } +} + +function getTreeLength(root: TreeNode | null): number { + if (!root) { + return 0; + } else { + return 1 + Math.max(getTreeLength(root.left), getTreeLength(root.right)); + } +} + +/** + * 自上而下递归 + * + * 时间复杂度:O(n^2),其中 n 是二叉树中的节点个数。 + * 最坏情况下,二叉树是满二叉树,需要遍历二叉树中的所有节点,时间复杂度是 O(n)。 + * 对于节点 p,如果它的高度是 d,则 height(p) 最多会被调用 d 次(即遍历到它的每一个祖先节点时)。对于平均的情况,一棵树的高度 h 满足 O(h)=O(logn),因为 d≤h,所以总时间复杂度为 O(nlogn)。对于最坏的情况,二叉树形成链式结构,高度为 O(n),此时总时间复杂度为 O(n^2)。 + * + * 空间复杂度:O(n),其中 n 是二叉树中的节点个数。空间复杂度主要取决于递归调用的层数,递归调用的层数不会超过 n。 + * @param root + */ +function isBalanced(root: TreeNode | null): boolean { + if (!root || !root.left && !root.right) { + return true; + } else { + return isBalanced(root.left) && isBalanced(root.right) && Math.abs(getTreeLength(root.left) - getTreeLength(root.right)) <= 1; + } +}; + +function getBalancedLength(root: TreeNode | null): number { + if (!root) { + return 0; + } else { + const leftLength = getBalancedLength(root.left); + const rightLength = getBalancedLength(root.right); + + if (leftLength < 0 || rightLength < 0 || Math.abs(leftLength - rightLength) > 1) { + return -1; + } else { + return Math.max(leftLength, rightLength) + 1; + } + } +} + +/** + * 自底向上的递归 + * + * 复杂度均为 O(n) + * @param root + */ +function isBalanced2(root: TreeNode | null): boolean { + if (!root || !root.left && !root.right) { + return true; + } else { + return getBalancedLength(root) >= 0; + } +}; \ No newline at end of file From b133444eb3e563e252b2d068c768950e980cdaca Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Thu, 23 Jun 2022 13:07:45 +0800 Subject: [PATCH 04/53] update: 114 --- README.md | 1 + src/flatten-binary-tree-to-linked-list/res.ts | 44 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 src/flatten-binary-tree-to-linked-list/res.ts diff --git a/README.md b/README.md index 121b286..b146142 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 108 | [Convert Sorted Array to Binary Search Tree](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/) | [JavaScript](./src/convert-sorted-array-to-binary-search-tree/res.js) | Easy | | 110 | [balanced-binary-tree](https://leetcode.com/problems/balanced-binary-tree/) | [TypeScript](./src/balanced-binary-tree/res.ts) | Easy | | 111 | [Minimum Depth of Binary Tree](https://leetcode.com/problems/minimum-depth-of-binary-tree/) | [JavaScript](./src/minimum-depth-of-binary-tree/res.js) | Easy | +| 114 | [flatten-binary-tree-to-linked-list](https://leetcode.com/problems/flatten-binary-tree-to-linked-list/) | [JavaScript](./src/flatten-binary-tree-to-linked-list/res.ts) | Medium | | 120 | [Triangle](https://leetcode.com/problems/triangle/) | [JavaScript](./src/triangle/res.js) | Medium | | 121 | [Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) | [JavaScript](./src/best-time-to-buy-and-sell-stock/res.js) | Easy | | 122 | [Best Time to Buy and Sell Stock II](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-ii/res.js) | Easy | diff --git a/src/flatten-binary-tree-to-linked-list/res.ts b/src/flatten-binary-tree-to-linked-list/res.ts new file mode 100644 index 0000000..e354def --- /dev/null +++ b/src/flatten-binary-tree-to-linked-list/res.ts @@ -0,0 +1,44 @@ +/** + * Definition for a binary tree node. + */ +class TreeNode { + val: number + left: TreeNode | null + right: TreeNode | null + constructor(val?: number, left?: TreeNode | null, right?: TreeNode | null) { + this.val = (val===undefined ? 0 : val) + this.left = (left===undefined ? null : left) + this.right = (right===undefined ? null : right) + } +} + +/** + Do not return anything, modify root in-place instead. + */ +function flatten(root: TreeNode | null): void { + if (!root) { + return ; + } + + const right = root.right; + + // 左子树 + if (root.left) { + flatten(root.left); + + // flatten 后根结点 + let currentNode = root.left; + while (currentNode.right) { + currentNode = currentNode.right; + } + + // 转移结构 + root.right = root.left; + currentNode.right = right; + root.left = null; + } + + if (right) { + flatten(right); + } +}; \ No newline at end of file From 99292bc67c37a429312c589316b54a98749b42a8 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Thu, 23 Jun 2022 15:52:38 +0800 Subject: [PATCH 05/53] update: 116 --- README.md | 3 +- .../res.ts | 47 +++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 src/populating-next-right-pointers-in-each-node/res.ts diff --git a/README.md b/README.md index b146142..89a6b78 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,8 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 108 | [Convert Sorted Array to Binary Search Tree](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/) | [JavaScript](./src/convert-sorted-array-to-binary-search-tree/res.js) | Easy | | 110 | [balanced-binary-tree](https://leetcode.com/problems/balanced-binary-tree/) | [TypeScript](./src/balanced-binary-tree/res.ts) | Easy | | 111 | [Minimum Depth of Binary Tree](https://leetcode.com/problems/minimum-depth-of-binary-tree/) | [JavaScript](./src/minimum-depth-of-binary-tree/res.js) | Easy | -| 114 | [flatten-binary-tree-to-linked-list](https://leetcode.com/problems/flatten-binary-tree-to-linked-list/) | [JavaScript](./src/flatten-binary-tree-to-linked-list/res.ts) | Medium | +| 114 | [flatten-binary-tree-to-linked-list](https://leetcode.com/problems/flatten-binary-tree-to-linked-list/) | [TypeScript](./src/flatten-binary-tree-to-linked-list/res.ts) | Medium | +| 116 | [populating-next-right-pointers-in-each-node](https://leetcode.com/problems/populating-next-right-pointers-in-each-node/) | [TypeScript](./src/populating-next-right-pointers-in-each-node/res.ts) | Medium | | 120 | [Triangle](https://leetcode.com/problems/triangle/) | [JavaScript](./src/triangle/res.js) | Medium | | 121 | [Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) | [JavaScript](./src/best-time-to-buy-and-sell-stock/res.js) | Easy | | 122 | [Best Time to Buy and Sell Stock II](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-ii/res.js) | Easy | diff --git a/src/populating-next-right-pointers-in-each-node/res.ts b/src/populating-next-right-pointers-in-each-node/res.ts new file mode 100644 index 0000000..5b509c3 --- /dev/null +++ b/src/populating-next-right-pointers-in-each-node/res.ts @@ -0,0 +1,47 @@ +// @ts-nocheck + +/** + * Definition for Node. + */ +class Node { + val: number + left: Node | null + right: Node | null + next: Node | null + constructor(val?: number, left?: Node, right?: Node, next?: Node) { + this.val = (val===undefined ? 0 : val) + this.left = (left===undefined ? null : left) + this.right = (right===undefined ? null : right) + this.next = (next===undefined ? null : next) + } +} + +function connect(root: Node | null): Node | null { + if (!root) { + return root; + } + + if (!root.left && !root.right) { + root.next = null; + return root; + } + + let queues = [root]; + while (queues.length) { + const currentLevel = queues.slice(); + queues = []; + + for (let i=0; i Date: Thu, 23 Jun 2022 16:05:38 +0800 Subject: [PATCH 06/53] update: 103 --- README.md | 1 + .../res.ts | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 src/binary-tree-zigzag-level-order-traversal/res.ts diff --git a/README.md b/README.md index 89a6b78..0668db2 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 100 | [Same Tree](https://leetcode.com/problems/same-tree/) | [JavaScript](./src/same-tree/res.js) | Easy | | 101 | [Symmetric Tree](https://leetcode.com/problems/symmetric-tree/) | [JavaScript](./src/symmetric-tree/res.js) | Easy | | 102 | [Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/) | [JavaScript](./src/binary-tree-level-order-traversal/res.js) | Medium | +| 103 | [binary-tree-zigzag-level-order-traversal](https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/) | [TypeScript](./src/binary-tree-zigzag-level-order-traversal/res.ts) | Medium | | 104 | [Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree/) | [JavaScript](./src/maximum-depth-of-binary-tree/res.js) | Easy | | 107 | [Binary Tree Level Order Traversal II](https://leetcode.com/problems/binary-tree-level-order-traversal-ii/) | [JavaScript](./src/binary-tree-level-order-traversal-ii/res.js) | Easy | | 108 | [Convert Sorted Array to Binary Search Tree](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/) | [JavaScript](./src/convert-sorted-array-to-binary-search-tree/res.js) | Easy | diff --git a/src/binary-tree-zigzag-level-order-traversal/res.ts b/src/binary-tree-zigzag-level-order-traversal/res.ts new file mode 100644 index 0000000..9b97038 --- /dev/null +++ b/src/binary-tree-zigzag-level-order-traversal/res.ts @@ -0,0 +1,46 @@ +/** + * Definition for a binary tree node. + */ +class TreeNode { + val: number + left: TreeNode | null + right: TreeNode | null + constructor(val?: number, left?: TreeNode | null, right?: TreeNode | null) { + this.val = (val===undefined ? 0 : val) + this.left = (left===undefined ? null : left) + this.right = (right===undefined ? null : right) + } +} + +function zigzagLevelOrder(root: TreeNode | null): number[][] { + const result = []; + let queues = [root]; + let reverse = true; + + if (!root) { + return result; + } + + while (queues.length) { + const currentLevel = queues.slice(); + const currentLevelList = []; + queues = []; + reverse = !reverse; + + for (let i = 0; i < currentLevel.length; i++) { + const currentNode = currentLevel[i]; + currentLevelList.push(currentNode.val); + + if (currentNode.left) { + queues.push(currentNode.left); + } + if (currentNode.right) { + queues.push(currentNode.right); + } + } + + result.push(reverse ? currentLevelList.reverse() : currentLevelList); + } + + return result; +}; \ No newline at end of file From b2a48d75b5934b5e736728e6702410106a7b2ac8 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Thu, 23 Jun 2022 17:59:27 +0800 Subject: [PATCH 07/53] update: 111 --- README.md | 294 ++++++++++++------------ src/minimum-depth-of-binary-tree/res.ts | 29 +++ 2 files changed, 176 insertions(+), 147 deletions(-) create mode 100644 src/minimum-depth-of-binary-tree/res.ts diff --git a/README.md b/README.md index 0668db2..32703b0 100644 --- a/README.md +++ b/README.md @@ -6,150 +6,150 @@ This is the solutions collection of my LeetCode submissions, most of them are pr **Progress: 127 Solutions** -| ID | Title | Solution | Difficulty | -|-----|-------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|------------| -| 1 | [Two Sum](https://leetcode.com/problems/two-sum/) | [JavaScript](./src/two-sum/res.js) | Easy | -| 2 | [Add Two Numbers](https://leetcode.com/problems/add-two-numbers/) | [JavaScript](./src/add-two-numbers/res.js) | Medium | -| 3 | [Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | [JavaScript](./src/longest-substring-without-repeating-characters/res.js) | Medium | -| 4 | [Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/) | [JavaScript](./src/median-of-two-sorted-arrays/res.js) | Hard | -| 5 | [Longest Palindromic Substring](https://leetcode.com/problems/longest-palindromic-substring/) | [JavaScript](./src/longest-palindromic-substring/res.js) | Medium | -| 6 | [ZigZag Conversion](https://leetcode.com/problems/zigzag-conversion/) | [JavaScript](./src/zigzag-conversion/res.js) | Medium | -| 7 | [Reverse Integer](https://leetcode.com/problems/reverse-integer/) | [JavaScript](./src/reverse-integer/res.js) | Easy | -| 8 | [String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi/) | [JavaScript](./src/string-to-integer-atoi/res.js) | Medium | -| 11 | [Container With Most Water](https://leetcode.com/problems/container-with-most-water/) | [JavaScript](./src/container-with-most-water/res.js) | Medium | -| 13 | [Roman to Integer](https://leetcode.com/problems/roman-to-integer/) | [JavaScript](./src/roman-to-integer/res.js) | Easy | -| 14 | [Longest Common Prefix](https://leetcode.com/problems/longest-common-prefix/) | [JavaScript](./src/longest-common-prefix/res.js) | Easy | -| 15 | [3Sum](https://leetcode.com/problems/3sum/) | [JavaScript](./src/3sum/res.js) | Medium | -| 16 | [3Sum Closest](https://leetcode.com/problems/3sum-closest/) | [JavaScript](./src/3sum-closest/res.js) | Medium | -| 17 | [Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/) | [JavaScript](./src/letter-combinations-of-a-phone-number/res.js) | Medium | -| 19 | [Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) | [JavaScript](./src/remove-nth-node-from-end-of-list/res.js) | Medium | -| 22 | [Generate Parentheses](https://leetcode.com/problems/generate-parentheses/) | [JavaScript](./src/generate-parentheses/res.js) | Medium | -| 26 | [Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/) | [JavaScript](./src/remove-duplicates-from-sorted-array/res.js) | Easy | -| 27 | [Remove Element](https://leetcode.com/problems/remove-element/) | [JavaScript](./src/remove-element/res.js) | Easy | -| 28 | [Implement strStr()](https://leetcode.com/problems/implement-strstr/) | [JavaScript](./src/implement-strstr/res.js) | Easy | -| 29 | [Divide Two Integers](https://leetcode.com/problems/divide-two-integers/) | [JavaScript](./src/divide-two-integers/res.js) | Medium | -| 33 | [Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/) | [JavaScript](./src/search-in-rotated-sorted-array/res.js) | Medium | -| 34 | [Search for a Range](https://leetcode.com/problems/search-for-a-range/) | [JavaScript](./src/search-for-a-range/res.js) | Medium | -| 35 | [Search Insert Position](https://leetcode.com/problems/search-insert-position/) | [JavaScript](./src/search-insert-position/res.js) | Easy | -| 39 | [Combination Sum](https://leetcode.com/problems/combination-sum/) | [JavaScript](./src/combination-sum/res.js) | Medium | -| 40 | [Combination Sum II](https://leetcode.com/problems/combination-sum-ii/) | [JavaScript](./src/combination-sum-ii/res.js) | Medium | -| 41 | [First Missing Positive](https://leetcode.com/problems/first-missing-positive/description/) | [JavaScript](./src/first-missing-positive/res.js) | Hard | -| 42 | [ Trapping Rain Water](https://leetcode.com/problems/trapping-rain-water/description/) | [JavaScript](./src/trapping-rain-water/res.js) | Hard | -| 43 | [Multiply Strings](https://leetcode.com/problems/multiply-strings/) | [JavaScript](./src/multiply-strings/res.js) | Medium | -| 45 | [Jump Game II](https://leetcode.com/problems/jump-game-ii/) | [JavaScript](./src/jump-game-ii/res.js) | Hard | -| 46 | [Permutations](https://leetcode.com/problems/permutations/) | [JavaScript](./src/permutations/res.js) | Medium | -| 48 | [Rotate Image](https://leetcode.com/problems/rotate-image/) | [JavaScript](./src/rotate-image/res.js) | Medium | -| 49 | [Group Anagrams](https://leetcode.com/problems/anagrams/) | [JavaScript](./src/anagrams/res.js) | Medium | -| 53 | [Maximum Subarray](https://leetcode.com/problems/maximum-subarray/) | [JavaScript](./src/maximum-subarray/res.js) | Easy | -| 54 | [Spiral Matrix](https://leetcode.com/problems/spiral-matrix/) | [JavaScript](./src/spiral-matrix/res.js) | Medium | -| 55 | [Jump Game](https://leetcode.com/problems/jump-game/) * | [JavaScript](./src/jump-game/res.js) | Medium | -| 56 | [Merge Intervals](https://leetcode.com/problems/merge-intervals/) | [JavaScript](./src/merge-intervals/res.js) | Medium | -| 57 | [Insert Interval](https://leetcode.com/problems/insert-interval/) | [JavaScript](./src/insert-interval/res.js) | Hard | -| 62 | [Unique Paths](https://leetcode.com/problems/unique-paths/) | [JavaScript](./src/unique-paths/res.js) | Medium | -| 63 | [Unique Paths ii](https://leetcode.com/problems/unique-paths-ii/) | [JavaScript](./src/unique-paths-ii/res.js) | Medium | -| 66 | [Plus One](https://leetcode.com/problems/plus-one/) | [JavaScript](./src/plus-one/res.js) | Easy | -| 69 | [Sqrt(x)](https://leetcode.com/problems/sqrtx/) | [JavaScript](./src/sqrtx/res.js) | Easy | -| 71 | [Simplify Path](https://leetcode.com/problems/simplify-path/) | [JavaScript](./src/simplify-path/res.js) | Medium | -| 73 | [Set Matrix Zeroes](https://leetcode.com/problems/set-matrix-zeroes/) | [JavaScript](./src/set-matrix-zeroes/res.js) | Medium | -| 75 | [Sort Colors](https://leetcode.com/problems/sort-colors/) | [JavaScript](./src/sort-colors/res.js) | Medium | -| 80 | [Remove Duplicates from Sorted Array II](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/) | [JavaScript](./src/remove-duplicates-from-sorted-array-ii/res.js) | Medium | -| 81 | [Search in Rotated Sorted Array II](https://leetcode.com/problems/search-in-rotated-sorted-array-ii/) | [JavaScript](./src/search-in-rotated-sorted-array-ii/res.js) | Medium | -| 88 | [ Merge Sorted Array](https://leetcode.com/problems/merge-sorted-array/) | [JavaScript](./src/merge-sorted-array/res.js) | Medium | -| 91 | [Decode Ways](https://leetcode.com/problems/decode-ways/) | [JavaScript](./src/decode-ways/res.js) | Medium | -| 93 | [Restore IP Addresses](https://leetcode.com/problems/restore-ip-addresses/) | [JavaScript](./src/restore-ip-addresses/res.js) | Medium | -| 94 | [Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal/) | [TypeScript](./src/binary-tree-inorder-traversal/res.ts) | Easy | -| 98 | [Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/) | [JavaScript](./src/validate-binary-search-tree/res.js) | Medium | -| 100 | [Same Tree](https://leetcode.com/problems/same-tree/) | [JavaScript](./src/same-tree/res.js) | Easy | -| 101 | [Symmetric Tree](https://leetcode.com/problems/symmetric-tree/) | [JavaScript](./src/symmetric-tree/res.js) | Easy | -| 102 | [Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/) | [JavaScript](./src/binary-tree-level-order-traversal/res.js) | Medium | -| 103 | [binary-tree-zigzag-level-order-traversal](https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/) | [TypeScript](./src/binary-tree-zigzag-level-order-traversal/res.ts) | Medium | -| 104 | [Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree/) | [JavaScript](./src/maximum-depth-of-binary-tree/res.js) | Easy | -| 107 | [Binary Tree Level Order Traversal II](https://leetcode.com/problems/binary-tree-level-order-traversal-ii/) | [JavaScript](./src/binary-tree-level-order-traversal-ii/res.js) | Easy | -| 108 | [Convert Sorted Array to Binary Search Tree](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/) | [JavaScript](./src/convert-sorted-array-to-binary-search-tree/res.js) | Easy | -| 110 | [balanced-binary-tree](https://leetcode.com/problems/balanced-binary-tree/) | [TypeScript](./src/balanced-binary-tree/res.ts) | Easy | -| 111 | [Minimum Depth of Binary Tree](https://leetcode.com/problems/minimum-depth-of-binary-tree/) | [JavaScript](./src/minimum-depth-of-binary-tree/res.js) | Easy | -| 114 | [flatten-binary-tree-to-linked-list](https://leetcode.com/problems/flatten-binary-tree-to-linked-list/) | [TypeScript](./src/flatten-binary-tree-to-linked-list/res.ts) | Medium | -| 116 | [populating-next-right-pointers-in-each-node](https://leetcode.com/problems/populating-next-right-pointers-in-each-node/) | [TypeScript](./src/populating-next-right-pointers-in-each-node/res.ts) | Medium | -| 120 | [Triangle](https://leetcode.com/problems/triangle/) | [JavaScript](./src/triangle/res.js) | Medium | -| 121 | [Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) | [JavaScript](./src/best-time-to-buy-and-sell-stock/res.js) | Easy | -| 122 | [Best Time to Buy and Sell Stock II](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-ii/res.js) | Easy | -| 123 | [Best Time to Buy and Sell Stock III](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/) * | [JavaScript](./src/best-time-to-buy-and-sell-stock-iii/res.js) | Hard | -| 127 | [Word Ladder](https://leetcode.com/problems/word-ladder/) | [JavaScript](./src/word-ladder/res.js) | Medium | -| 128 | [Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence/) | [JavaScript](./src/longest-consecutive-sequence/res.js) | Medium | -| 130 | [Surrounded Regions](https://leetcode.com/problems/surrounded-regions/) | [JavaScript](./src/surrounded-regions/res.js) | Medium | -| 133 | [Clone Graph](https://leetcode.com/problems/clone-graph/) | [JavaScript](./src/clone-graph/res.js) | Medium | -| 134 | [Gas Station](https://leetcode.com/problems/gas-station/) | [JavaScript](./src/gas-station/res.js) | Medium | -| 135 | [Candy](https://leetcode.com/problems/candy/) | [JavaScript](./src/candy/res.js) | Hard | -| 136 | [Single Number](https://leetcode.com/problems/single-number/) | [JavaScript](./src/single-number/res.js) | Easy | -| 137 | [Single Number II](https://leetcode.com/problems/single-number-ii/) | [JavaScript](./src/single-number-ii/res.js) | Medium | -| 151 | [Reverse Words in a String](https://leetcode.com/problems/reverse-words-in-a-string/) | [JavaScript](./src/reverse-words-in-a-string/res.js) | Medium | -| 152 | [Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray/) | [JavaScript](./src/maximum-product-subarray/res.js) | Medium | -| 153 | [Find Minimum in Rotated Sorted Array](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/) | [JavaScript](./src/find-minimum-in-rotated-sorted-array/res.js) | Medium | -| 154 | [Find Minimum in Rotated Sorted Array II](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/) | [JavaScript](./src/find-minimum-in-rotated-sorted-array-ii/res.js) | Medium | -| 162 | [Find Peak Element](https://leetcode.com/problems/find-peak-element/) | [JavaScript](./src/find-peak-element/res.js) | Medium | -| 164 | [Maximum Gap](https://leetcode.com/problems/maximum-gap/) | [JavaScript](./src/maximum-gap/res.js) | Hard | -| 165 | [Compare Version Numbers](https://leetcode.com/problems/compare-version-numbers/) | [JavaScript](./src/compare-version-numbers/res.js) | Medium | -| 169 | [Majority Element](https://leetcode.com/problems/majority-element/) | [JavaScript](./src/majority-element/res.js) | Easy | -| 175 | [Combine Two Tables](https://leetcode.com/problems/combine-two-tables/) | [SQL](./src/combine-two-tables/res.txt) | Easy | -| 176 | [Second Highest Salary](https://leetcode.com/problems/second-highest-salary/) | [SQL](./src/second-highest-salary/res.txt) | Easy | -| 177 | [Nth Highest Salary](https://leetcode.com/problems/nth-highest-salary/) | [SQL](./src/nth-highest-salary/res.txt) | Medium | -| 181 | [Employees Earning More Than Their Managers](https://leetcode.com/problems/employees-earning-more-than-their-managers/) | [SQL](./src/employees-earning-more-than-their-managers/res.txt) | Easy | -| 182 | [Duplicate Emails](https://leetcode.com/problems/duplicate-emails/) | [SQL](./src/duplicate-emails/res.txt) | Easy | -| 183 | [Customers Who Never Order](https://leetcode.com/problems/customers-who-never-order/) | [SQL](./src/customers-who-never-order/res.txt) | Easy | -| 184 | [Department Highest Salary](https://leetcode.com/problems/department-highest-salary/) | [SQL](./src/department-highest-salary/res.txt) | Medium | -| 188 | [Best Time to Buy and Sell Stock IV](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-iv/res.txt) | Hard | -| 189 | [Rotate Array](https://leetcode.com/problems/rotate-array/) | [JavaScript](./src/rotate-array/res.js) | Easy | -| 190 | [Reverse Bits](https://leetcode.com/problems/reverse-bits/) | [JavaScript](./src/reverse-bits/res.js) | Easy | -| 196 | [Delete Duplicate Emails](https://leetcode.com/problems/delete-duplicate-emails/) | [SQL](./src/delete-duplicate-emails/res.txt) | Easy | -| 197 | [Rising Temperature](https://leetcode.com/problems/rising-temperature/) | [SQL](./src/rising-temperature/res.txt) | Easy | -| 206 | [Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/) | [JavaScript](./src/reverse-linked-list/res.js) | Easy | -| 207 | [Course Schedule](https://leetcode.com/problems/course-schedule/) | [JavaScript](./src/course-schedule/res.js) | Medium | -| 209 | [Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum/) | [JavaScript](./src/minimum-size-subarray-sum/res.js) | Medium | -| 210 | [Course Schedule II](https://leetcode.com/problems/course-schedule-ii/) | [JavaScript](./src/course-schedule-ii/res.js) | Medium | -| 215 | [Kth Largest Element in an Array](https://leetcode.com/problems/kth-largest-element-in-an-array/) | [JavaScript](./src/kth-largest-element-in-an-array/res.js) | Medium | -| 217 | [Contains Duplicate](https://leetcode.com/problems/contains-duplicate/) | [JavaScript](./src/contains-duplicate/res.js) | Easy | -| 219 | [Contains Duplicate II](https://leetcode.com/problems/contains-duplicate-ii/) | [JavaScript](./src/contains-duplicate-ii/res.js) | Easy | -| 220 | [Contains Duplicate III](https://leetcode.com/problems/contains-duplicate-iii/) | [JavaScript](./src/contains-duplicate-iii/res.js) | Medium | -| 228 | [Summary Ranges](https://leetcode.com/problems/summary-ranges/solution/) | [JavaScript](./src/summary-ranges/res.js) | Medium | -| 238 | [Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/solution/) | [JavaScript](./src/product-of-array-except-self/res.js) | Medium | -| 239 | [Sliding Window Maximum](https://leetcode.com/problems/sliding-window-maximum/description/) | [JavaScript](./src/sliding-window-maximum/description/res.js) | Hard | -| 240 | [Search a 2D Matrix II](https://leetcode.com/problems/search-a-2d-matrix-ii/) | [JavaScript](./src/search-a-2d-matrix-ii/res.js) | Medium | -| 274 | [H-Index](https://leetcode.com/problems/h-index/) | [JavaScript](./src/h-index/res.js) | Medium | -| 275 | [H-Index II](https://leetcode.com/problems/h-index-ii/) | [JavaScript](./src/h-index-ii/res.js) | Medium | -| 278 | [First Bad Version](https://leetcode.com/problems/first-bad-version/) | [JavaScript](./src/first-bad-version/res.js) | Easy | -| 283 | [Move Zeroes](https://leetcode.com/problems/move-zeroes/) | [JavaScript](./src/move-zeroes/res.js) | Easy | -| 287 | [Find the Duplicate Number](https://leetcode.com/problems/find-the-duplicate-number/) | [JavaScript](./src/find-the-duplicate-number/res.js) | Medium | -| 289 | [Game of Life](https://leetcode.com/problems/game-of-life/) | [JavaScript](./src/game-of-life/res.js) | Medium | -| 295 | [Find Median from Data Stream](https://leetcode.com/problems/find-median-from-data-stream/) | [JavaScript](./src/find-median-from-data-stream/res.js) | Hard | -| 299 | [Bulls and Cows](https://leetcode.com/problems/bulls-and-cows/) | [JavaScript](./src/bulls-and-cows/res.js) | Medium | -| 300 | [Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence/) | [JavaScript](./src/longest-increasing-subsequence/res.js) | Medium | -| 307 | [Range Sum Query - Mutable](https://leetcode.com/problems/range-sum-query-mutable/) | [JavaScript](./src/range-sum-query-mutable/res.js) | Medium | -| 309 | [Best Time to Buy and Sell Stock with Cooldown](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-with-cooldown/res.js) | Medium | -| 310 | [Minimum Height Trees](https://leetcode.com/problems/minimum-height-trees/) | [JavaScript](./src/minimum-height-trees/res.js) | Medium | -| 315 | [Count of Smaller Numbers After Self](https://leetcode.com/problems/count-of-smaller-numbers-after-self/) * | [JavaScript](./src/count-of-smaller-numbers-after-self/res.js) | Hard | -| 322 | [Coin Change](https://leetcode.com/problems/coin-change/) | [JavaScript](./src/coin-change/res.js) | Medium | -| 327 | [Count of Range Sum](https://leetcode.com/problems/count-of-range-sum/) | [JavaScript](./src/count-of-range-sum/res.js) | Hard | -| 334 | [Increasing Triplet Subsequence](https://leetcode.com/problems/increasing-triplet-subsequence/) | [JavaScript](./src/increasing-triplet-subsequence/res.js) | Medium | -| 340 | [Longest Substring with At Most K Distinct Characters](https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters/) | [JavaScript](./src/longest-substring-with-at-most-k-distinct-characters/res.js) | Hard | -| 342 | [Power of Four](https://leetcode.com/problems/power-of-four/) | [JavaScript](./src/power-of-four/res.js) | Easy | -| 344 | [Reverse String](https://leetcode.com/problems/reverse-string/) | [JavaScript](./src/reverse-string/res.js) | Easy | -| 349 | [Intersection of Two Arrays](https://leetcode.com/problems/intersection-of-two-arrays/) | [JavaScript](./src/intersection-of-two-arrays/res.js) | Easy | -| 350 | [Intersection of Two Arrays ii](https://leetcode.com/problems/intersection-of-two-arrays-ii/) | [JavaScript](./src/intersection-of-two-arrays-ii/res.js) | Easy | -| 371 | [Sum of Two Integers](https://leetcode.com/problems/sum-of-two-integers/) | [JavaScript](./src/sum-of-two-integers/res.js) | Easy | -| 374 | [Guess Number Higher or Lower](https://leetcode.com/problems/guess-number-higher-or-lower/) | [JavaScript](./src/guess-number-higher-or-lower/res.py) | Easy | -| 376 | [Wiggle Subsequence](https://leetcode.com/problems/wiggle-subsequence/) | [JavaScript](./src/wiggle-subsequence/res.js) | Medium | -| 384 | [Shuffle an Array](https://leetcode.com/problems/shuffle-an-array/) | [JavaScript](./src/shuffle-an-array/res.js) | Medium | -| 395 | [Longest Substring with At Least K Repeating Characters](https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters/) | [JavaScript](./src/longest-substring-with-at-least-k-repeating-characters/res.js) | Medium | -| 404 | [Sum of Left Leaves](https://leetcode.com/problems/sum-of-left-leaves/) | [JavaScript](./src/sum-of-left-leaves/res.js) | Easy | -| 413 | [Arithmetic Slices](https://leetcode.com/problems/arithmetic-slices/) | [JavaScript](./src/arithmetic-slices/res.js) | Medium | -| 416 | [Partition Equal Subset Sum](https://leetcode.com/problems/partition-equal-subset-sum/) | [JavaScript](./src/partition-equal-subset-sum/res.js) | Medium | -| 424 | [Longest Repeating Character Replacement](https://leetcode.com/problems/longest-repeating-character-replacement/) | [JavaScript](./src/longest-repeating-character-replacement/res.js) | Medium | -| 434 | [Number of Segments in a String](https://leetcode.com/problems/number-of-segments-in-a-string/) | [JavaScript](./src/number-of-segments-in-a-string/res.js) | Easy | -| 486 | [Predict the Winner](https://leetcode.com/problems/predict-the-winner/) | [JavaScript](./src/predict-the-winner/res.js) | Medium | -| 494 | [Target Sum](https://leetcode.com/problems/target-sum/) | [JavaScript](./src/target-sum/res.js) | Medium | -| 516 | [Longest Palindromic Subsequence](https://leetcode.com/problems/longest-palindromic-subsequence/) | [JavaScript](./src/longest-palindromic-subsequence/res.js) | Medium | -| 523 | [Continuous Subarray Sum](https://leetcode.com/problems/continuous-subarray-sum/) | [JavaScript](./src/continuous-subarray-sum/res.js) | Medium | -| 539 | [Minimum Time Difference](https://leetcode.com/problems/minimum-time-difference/) | [JavaScript](./src/minimum-time-difference/res.js) | Medium | -| 687 | [Longest Univalue Path](https://leetcode.com/problems/longest-univalue-path/) | [JavaScript](./src/longest-univalue-path/res.js) | Easy | -| 779 | [K-th Symbol in Grammar](https://leetcode.com/problems/k-th-symbol-in-grammar/) | [JavaScript](./src/k-th-symbol-in-grammar/res.js) | Medium | -| NO | [NAME](https://leetcode.com/problems/XXX/) | [TypeScript](./src/XXX/res.ts) | Easy | +| ID | Title | Solution | Difficulty | +|-----|-------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|------------| +| 1 | [Two Sum](https://leetcode.com/problems/two-sum/) | [JavaScript](./src/two-sum/res.js) | Easy | +| 2 | [Add Two Numbers](https://leetcode.com/problems/add-two-numbers/) | [JavaScript](./src/add-two-numbers/res.js) | Medium | +| 3 | [Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | [JavaScript](./src/longest-substring-without-repeating-characters/res.js) | Medium | +| 4 | [Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/) | [JavaScript](./src/median-of-two-sorted-arrays/res.js) | Hard | +| 5 | [Longest Palindromic Substring](https://leetcode.com/problems/longest-palindromic-substring/) | [JavaScript](./src/longest-palindromic-substring/res.js) | Medium | +| 6 | [ZigZag Conversion](https://leetcode.com/problems/zigzag-conversion/) | [JavaScript](./src/zigzag-conversion/res.js) | Medium | +| 7 | [Reverse Integer](https://leetcode.com/problems/reverse-integer/) | [JavaScript](./src/reverse-integer/res.js) | Easy | +| 8 | [String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi/) | [JavaScript](./src/string-to-integer-atoi/res.js) | Medium | +| 11 | [Container With Most Water](https://leetcode.com/problems/container-with-most-water/) | [JavaScript](./src/container-with-most-water/res.js) | Medium | +| 13 | [Roman to Integer](https://leetcode.com/problems/roman-to-integer/) | [JavaScript](./src/roman-to-integer/res.js) | Easy | +| 14 | [Longest Common Prefix](https://leetcode.com/problems/longest-common-prefix/) | [JavaScript](./src/longest-common-prefix/res.js) | Easy | +| 15 | [3Sum](https://leetcode.com/problems/3sum/) | [JavaScript](./src/3sum/res.js) | Medium | +| 16 | [3Sum Closest](https://leetcode.com/problems/3sum-closest/) | [JavaScript](./src/3sum-closest/res.js) | Medium | +| 17 | [Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/) | [JavaScript](./src/letter-combinations-of-a-phone-number/res.js) | Medium | +| 19 | [Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) | [JavaScript](./src/remove-nth-node-from-end-of-list/res.js) | Medium | +| 22 | [Generate Parentheses](https://leetcode.com/problems/generate-parentheses/) | [JavaScript](./src/generate-parentheses/res.js) | Medium | +| 26 | [Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/) | [JavaScript](./src/remove-duplicates-from-sorted-array/res.js) | Easy | +| 27 | [Remove Element](https://leetcode.com/problems/remove-element/) | [JavaScript](./src/remove-element/res.js) | Easy | +| 28 | [Implement strStr()](https://leetcode.com/problems/implement-strstr/) | [JavaScript](./src/implement-strstr/res.js) | Easy | +| 29 | [Divide Two Integers](https://leetcode.com/problems/divide-two-integers/) | [JavaScript](./src/divide-two-integers/res.js) | Medium | +| 33 | [Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/) | [JavaScript](./src/search-in-rotated-sorted-array/res.js) | Medium | +| 34 | [Search for a Range](https://leetcode.com/problems/search-for-a-range/) | [JavaScript](./src/search-for-a-range/res.js) | Medium | +| 35 | [Search Insert Position](https://leetcode.com/problems/search-insert-position/) | [JavaScript](./src/search-insert-position/res.js) | Easy | +| 39 | [Combination Sum](https://leetcode.com/problems/combination-sum/) | [JavaScript](./src/combination-sum/res.js) | Medium | +| 40 | [Combination Sum II](https://leetcode.com/problems/combination-sum-ii/) | [JavaScript](./src/combination-sum-ii/res.js) | Medium | +| 41 | [First Missing Positive](https://leetcode.com/problems/first-missing-positive/description/) | [JavaScript](./src/first-missing-positive/res.js) | Hard | +| 42 | [ Trapping Rain Water](https://leetcode.com/problems/trapping-rain-water/description/) | [JavaScript](./src/trapping-rain-water/res.js) | Hard | +| 43 | [Multiply Strings](https://leetcode.com/problems/multiply-strings/) | [JavaScript](./src/multiply-strings/res.js) | Medium | +| 45 | [Jump Game II](https://leetcode.com/problems/jump-game-ii/) | [JavaScript](./src/jump-game-ii/res.js) | Hard | +| 46 | [Permutations](https://leetcode.com/problems/permutations/) | [JavaScript](./src/permutations/res.js) | Medium | +| 48 | [Rotate Image](https://leetcode.com/problems/rotate-image/) | [JavaScript](./src/rotate-image/res.js) | Medium | +| 49 | [Group Anagrams](https://leetcode.com/problems/anagrams/) | [JavaScript](./src/anagrams/res.js) | Medium | +| 53 | [Maximum Subarray](https://leetcode.com/problems/maximum-subarray/) | [JavaScript](./src/maximum-subarray/res.js) | Easy | +| 54 | [Spiral Matrix](https://leetcode.com/problems/spiral-matrix/) | [JavaScript](./src/spiral-matrix/res.js) | Medium | +| 55 | [Jump Game](https://leetcode.com/problems/jump-game/) * | [JavaScript](./src/jump-game/res.js) | Medium | +| 56 | [Merge Intervals](https://leetcode.com/problems/merge-intervals/) | [JavaScript](./src/merge-intervals/res.js) | Medium | +| 57 | [Insert Interval](https://leetcode.com/problems/insert-interval/) | [JavaScript](./src/insert-interval/res.js) | Hard | +| 62 | [Unique Paths](https://leetcode.com/problems/unique-paths/) | [JavaScript](./src/unique-paths/res.js) | Medium | +| 63 | [Unique Paths ii](https://leetcode.com/problems/unique-paths-ii/) | [JavaScript](./src/unique-paths-ii/res.js) | Medium | +| 66 | [Plus One](https://leetcode.com/problems/plus-one/) | [JavaScript](./src/plus-one/res.js) | Easy | +| 69 | [Sqrt(x)](https://leetcode.com/problems/sqrtx/) | [JavaScript](./src/sqrtx/res.js) | Easy | +| 71 | [Simplify Path](https://leetcode.com/problems/simplify-path/) | [JavaScript](./src/simplify-path/res.js) | Medium | +| 73 | [Set Matrix Zeroes](https://leetcode.com/problems/set-matrix-zeroes/) | [JavaScript](./src/set-matrix-zeroes/res.js) | Medium | +| 75 | [Sort Colors](https://leetcode.com/problems/sort-colors/) | [JavaScript](./src/sort-colors/res.js) | Medium | +| 80 | [Remove Duplicates from Sorted Array II](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/) | [JavaScript](./src/remove-duplicates-from-sorted-array-ii/res.js) | Medium | +| 81 | [Search in Rotated Sorted Array II](https://leetcode.com/problems/search-in-rotated-sorted-array-ii/) | [JavaScript](./src/search-in-rotated-sorted-array-ii/res.js) | Medium | +| 88 | [ Merge Sorted Array](https://leetcode.com/problems/merge-sorted-array/) | [JavaScript](./src/merge-sorted-array/res.js) | Medium | +| 91 | [Decode Ways](https://leetcode.com/problems/decode-ways/) | [JavaScript](./src/decode-ways/res.js) | Medium | +| 93 | [Restore IP Addresses](https://leetcode.com/problems/restore-ip-addresses/) | [JavaScript](./src/restore-ip-addresses/res.js) | Medium | +| 94 | [Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal/) | [TypeScript](./src/binary-tree-inorder-traversal/res.ts) | Easy | +| 98 | [Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/) | [JavaScript](./src/validate-binary-search-tree/res.js) | Medium | +| 100 | [Same Tree](https://leetcode.com/problems/same-tree/) | [JavaScript](./src/same-tree/res.js) | Easy | +| 101 | [Symmetric Tree](https://leetcode.com/problems/symmetric-tree/) | [JavaScript](./src/symmetric-tree/res.js) | Easy | +| 102 | [Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/) | [JavaScript](./src/binary-tree-level-order-traversal/res.js) | Medium | +| 103 | [binary-tree-zigzag-level-order-traversal](https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/) | [TypeScript](./src/binary-tree-zigzag-level-order-traversal/res.ts) | Medium | +| 104 | [Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree/) | [JavaScript](./src/maximum-depth-of-binary-tree/res.js) | Easy | +| 107 | [Binary Tree Level Order Traversal II](https://leetcode.com/problems/binary-tree-level-order-traversal-ii/) | [JavaScript](./src/binary-tree-level-order-traversal-ii/res.js) | Easy | +| 108 | [Convert Sorted Array to Binary Search Tree](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/) | [JavaScript](./src/convert-sorted-array-to-binary-search-tree/res.js) | Easy | +| 110 | [balanced-binary-tree](https://leetcode.com/problems/balanced-binary-tree/) | [TypeScript](./src/balanced-binary-tree/res.ts) | Easy | +| 111 | [Minimum Depth of Binary Tree](https://leetcode.com/problems/minimum-depth-of-binary-tree/) | [JavaScript](./src/minimum-depth-of-binary-tree/res.js) · [TypeScript](./src/minimum-depth-of-binary-tree/res.ts) | Easy | +| 114 | [flatten-binary-tree-to-linked-list](https://leetcode.com/problems/flatten-binary-tree-to-linked-list/) | [TypeScript](./src/flatten-binary-tree-to-linked-list/res.ts) | Medium | +| 116 | [populating-next-right-pointers-in-each-node](https://leetcode.com/problems/populating-next-right-pointers-in-each-node/) | [TypeScript](./src/populating-next-right-pointers-in-each-node/res.ts) | Medium | +| 120 | [Triangle](https://leetcode.com/problems/triangle/) | [JavaScript](./src/triangle/res.js) | Medium | +| 121 | [Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) | [JavaScript](./src/best-time-to-buy-and-sell-stock/res.js) | Easy | +| 122 | [Best Time to Buy and Sell Stock II](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-ii/res.js) | Easy | +| 123 | [Best Time to Buy and Sell Stock III](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/) * | [JavaScript](./src/best-time-to-buy-and-sell-stock-iii/res.js) | Hard | +| 127 | [Word Ladder](https://leetcode.com/problems/word-ladder/) | [JavaScript](./src/word-ladder/res.js) | Medium | +| 128 | [Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence/) | [JavaScript](./src/longest-consecutive-sequence/res.js) | Medium | +| 130 | [Surrounded Regions](https://leetcode.com/problems/surrounded-regions/) | [JavaScript](./src/surrounded-regions/res.js) | Medium | +| 133 | [Clone Graph](https://leetcode.com/problems/clone-graph/) | [JavaScript](./src/clone-graph/res.js) | Medium | +| 134 | [Gas Station](https://leetcode.com/problems/gas-station/) | [JavaScript](./src/gas-station/res.js) | Medium | +| 135 | [Candy](https://leetcode.com/problems/candy/) | [JavaScript](./src/candy/res.js) | Hard | +| 136 | [Single Number](https://leetcode.com/problems/single-number/) | [JavaScript](./src/single-number/res.js) | Easy | +| 137 | [Single Number II](https://leetcode.com/problems/single-number-ii/) | [JavaScript](./src/single-number-ii/res.js) | Medium | +| 151 | [Reverse Words in a String](https://leetcode.com/problems/reverse-words-in-a-string/) | [JavaScript](./src/reverse-words-in-a-string/res.js) | Medium | +| 152 | [Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray/) | [JavaScript](./src/maximum-product-subarray/res.js) | Medium | +| 153 | [Find Minimum in Rotated Sorted Array](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/) | [JavaScript](./src/find-minimum-in-rotated-sorted-array/res.js) | Medium | +| 154 | [Find Minimum in Rotated Sorted Array II](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/) | [JavaScript](./src/find-minimum-in-rotated-sorted-array-ii/res.js) | Medium | +| 162 | [Find Peak Element](https://leetcode.com/problems/find-peak-element/) | [JavaScript](./src/find-peak-element/res.js) | Medium | +| 164 | [Maximum Gap](https://leetcode.com/problems/maximum-gap/) | [JavaScript](./src/maximum-gap/res.js) | Hard | +| 165 | [Compare Version Numbers](https://leetcode.com/problems/compare-version-numbers/) | [JavaScript](./src/compare-version-numbers/res.js) | Medium | +| 169 | [Majority Element](https://leetcode.com/problems/majority-element/) | [JavaScript](./src/majority-element/res.js) | Easy | +| 175 | [Combine Two Tables](https://leetcode.com/problems/combine-two-tables/) | [SQL](./src/combine-two-tables/res.txt) | Easy | +| 176 | [Second Highest Salary](https://leetcode.com/problems/second-highest-salary/) | [SQL](./src/second-highest-salary/res.txt) | Easy | +| 177 | [Nth Highest Salary](https://leetcode.com/problems/nth-highest-salary/) | [SQL](./src/nth-highest-salary/res.txt) | Medium | +| 181 | [Employees Earning More Than Their Managers](https://leetcode.com/problems/employees-earning-more-than-their-managers/) | [SQL](./src/employees-earning-more-than-their-managers/res.txt) | Easy | +| 182 | [Duplicate Emails](https://leetcode.com/problems/duplicate-emails/) | [SQL](./src/duplicate-emails/res.txt) | Easy | +| 183 | [Customers Who Never Order](https://leetcode.com/problems/customers-who-never-order/) | [SQL](./src/customers-who-never-order/res.txt) | Easy | +| 184 | [Department Highest Salary](https://leetcode.com/problems/department-highest-salary/) | [SQL](./src/department-highest-salary/res.txt) | Medium | +| 188 | [Best Time to Buy and Sell Stock IV](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-iv/res.txt) | Hard | +| 189 | [Rotate Array](https://leetcode.com/problems/rotate-array/) | [JavaScript](./src/rotate-array/res.js) | Easy | +| 190 | [Reverse Bits](https://leetcode.com/problems/reverse-bits/) | [JavaScript](./src/reverse-bits/res.js) | Easy | +| 196 | [Delete Duplicate Emails](https://leetcode.com/problems/delete-duplicate-emails/) | [SQL](./src/delete-duplicate-emails/res.txt) | Easy | +| 197 | [Rising Temperature](https://leetcode.com/problems/rising-temperature/) | [SQL](./src/rising-temperature/res.txt) | Easy | +| 206 | [Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/) | [JavaScript](./src/reverse-linked-list/res.js) | Easy | +| 207 | [Course Schedule](https://leetcode.com/problems/course-schedule/) | [JavaScript](./src/course-schedule/res.js) | Medium | +| 209 | [Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum/) | [JavaScript](./src/minimum-size-subarray-sum/res.js) | Medium | +| 210 | [Course Schedule II](https://leetcode.com/problems/course-schedule-ii/) | [JavaScript](./src/course-schedule-ii/res.js) | Medium | +| 215 | [Kth Largest Element in an Array](https://leetcode.com/problems/kth-largest-element-in-an-array/) | [JavaScript](./src/kth-largest-element-in-an-array/res.js) | Medium | +| 217 | [Contains Duplicate](https://leetcode.com/problems/contains-duplicate/) | [JavaScript](./src/contains-duplicate/res.js) | Easy | +| 219 | [Contains Duplicate II](https://leetcode.com/problems/contains-duplicate-ii/) | [JavaScript](./src/contains-duplicate-ii/res.js) | Easy | +| 220 | [Contains Duplicate III](https://leetcode.com/problems/contains-duplicate-iii/) | [JavaScript](./src/contains-duplicate-iii/res.js) | Medium | +| 228 | [Summary Ranges](https://leetcode.com/problems/summary-ranges/solution/) | [JavaScript](./src/summary-ranges/res.js) | Medium | +| 238 | [Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/solution/) | [JavaScript](./src/product-of-array-except-self/res.js) | Medium | +| 239 | [Sliding Window Maximum](https://leetcode.com/problems/sliding-window-maximum/description/) | [JavaScript](./src/sliding-window-maximum/description/res.js) | Hard | +| 240 | [Search a 2D Matrix II](https://leetcode.com/problems/search-a-2d-matrix-ii/) | [JavaScript](./src/search-a-2d-matrix-ii/res.js) | Medium | +| 274 | [H-Index](https://leetcode.com/problems/h-index/) | [JavaScript](./src/h-index/res.js) | Medium | +| 275 | [H-Index II](https://leetcode.com/problems/h-index-ii/) | [JavaScript](./src/h-index-ii/res.js) | Medium | +| 278 | [First Bad Version](https://leetcode.com/problems/first-bad-version/) | [JavaScript](./src/first-bad-version/res.js) | Easy | +| 283 | [Move Zeroes](https://leetcode.com/problems/move-zeroes/) | [JavaScript](./src/move-zeroes/res.js) | Easy | +| 287 | [Find the Duplicate Number](https://leetcode.com/problems/find-the-duplicate-number/) | [JavaScript](./src/find-the-duplicate-number/res.js) | Medium | +| 289 | [Game of Life](https://leetcode.com/problems/game-of-life/) | [JavaScript](./src/game-of-life/res.js) | Medium | +| 295 | [Find Median from Data Stream](https://leetcode.com/problems/find-median-from-data-stream/) | [JavaScript](./src/find-median-from-data-stream/res.js) | Hard | +| 299 | [Bulls and Cows](https://leetcode.com/problems/bulls-and-cows/) | [JavaScript](./src/bulls-and-cows/res.js) | Medium | +| 300 | [Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence/) | [JavaScript](./src/longest-increasing-subsequence/res.js) | Medium | +| 307 | [Range Sum Query - Mutable](https://leetcode.com/problems/range-sum-query-mutable/) | [JavaScript](./src/range-sum-query-mutable/res.js) | Medium | +| 309 | [Best Time to Buy and Sell Stock with Cooldown](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-with-cooldown/res.js) | Medium | +| 310 | [Minimum Height Trees](https://leetcode.com/problems/minimum-height-trees/) | [JavaScript](./src/minimum-height-trees/res.js) | Medium | +| 315 | [Count of Smaller Numbers After Self](https://leetcode.com/problems/count-of-smaller-numbers-after-self/) * | [JavaScript](./src/count-of-smaller-numbers-after-self/res.js) | Hard | +| 322 | [Coin Change](https://leetcode.com/problems/coin-change/) | [JavaScript](./src/coin-change/res.js) | Medium | +| 327 | [Count of Range Sum](https://leetcode.com/problems/count-of-range-sum/) | [JavaScript](./src/count-of-range-sum/res.js) | Hard | +| 334 | [Increasing Triplet Subsequence](https://leetcode.com/problems/increasing-triplet-subsequence/) | [JavaScript](./src/increasing-triplet-subsequence/res.js) | Medium | +| 340 | [Longest Substring with At Most K Distinct Characters](https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters/) | [JavaScript](./src/longest-substring-with-at-most-k-distinct-characters/res.js) | Hard | +| 342 | [Power of Four](https://leetcode.com/problems/power-of-four/) | [JavaScript](./src/power-of-four/res.js) | Easy | +| 344 | [Reverse String](https://leetcode.com/problems/reverse-string/) | [JavaScript](./src/reverse-string/res.js) | Easy | +| 349 | [Intersection of Two Arrays](https://leetcode.com/problems/intersection-of-two-arrays/) | [JavaScript](./src/intersection-of-two-arrays/res.js) | Easy | +| 350 | [Intersection of Two Arrays ii](https://leetcode.com/problems/intersection-of-two-arrays-ii/) | [JavaScript](./src/intersection-of-two-arrays-ii/res.js) | Easy | +| 371 | [Sum of Two Integers](https://leetcode.com/problems/sum-of-two-integers/) | [JavaScript](./src/sum-of-two-integers/res.js) | Easy | +| 374 | [Guess Number Higher or Lower](https://leetcode.com/problems/guess-number-higher-or-lower/) | [JavaScript](./src/guess-number-higher-or-lower/res.py) | Easy | +| 376 | [Wiggle Subsequence](https://leetcode.com/problems/wiggle-subsequence/) | [JavaScript](./src/wiggle-subsequence/res.js) | Medium | +| 384 | [Shuffle an Array](https://leetcode.com/problems/shuffle-an-array/) | [JavaScript](./src/shuffle-an-array/res.js) | Medium | +| 395 | [Longest Substring with At Least K Repeating Characters](https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters/) | [JavaScript](./src/longest-substring-with-at-least-k-repeating-characters/res.js) | Medium | +| 404 | [Sum of Left Leaves](https://leetcode.com/problems/sum-of-left-leaves/) | [JavaScript](./src/sum-of-left-leaves/res.js) | Easy | +| 413 | [Arithmetic Slices](https://leetcode.com/problems/arithmetic-slices/) | [JavaScript](./src/arithmetic-slices/res.js) | Medium | +| 416 | [Partition Equal Subset Sum](https://leetcode.com/problems/partition-equal-subset-sum/) | [JavaScript](./src/partition-equal-subset-sum/res.js) | Medium | +| 424 | [Longest Repeating Character Replacement](https://leetcode.com/problems/longest-repeating-character-replacement/) | [JavaScript](./src/longest-repeating-character-replacement/res.js) | Medium | +| 434 | [Number of Segments in a String](https://leetcode.com/problems/number-of-segments-in-a-string/) | [JavaScript](./src/number-of-segments-in-a-string/res.js) | Easy | +| 486 | [Predict the Winner](https://leetcode.com/problems/predict-the-winner/) | [JavaScript](./src/predict-the-winner/res.js) | Medium | +| 494 | [Target Sum](https://leetcode.com/problems/target-sum/) | [JavaScript](./src/target-sum/res.js) | Medium | +| 516 | [Longest Palindromic Subsequence](https://leetcode.com/problems/longest-palindromic-subsequence/) | [JavaScript](./src/longest-palindromic-subsequence/res.js) | Medium | +| 523 | [Continuous Subarray Sum](https://leetcode.com/problems/continuous-subarray-sum/) | [JavaScript](./src/continuous-subarray-sum/res.js) | Medium | +| 539 | [Minimum Time Difference](https://leetcode.com/problems/minimum-time-difference/) | [JavaScript](./src/minimum-time-difference/res.js) | Medium | +| 687 | [Longest Univalue Path](https://leetcode.com/problems/longest-univalue-path/) | [JavaScript](./src/longest-univalue-path/res.js) | Easy | +| 779 | [K-th Symbol in Grammar](https://leetcode.com/problems/k-th-symbol-in-grammar/) | [JavaScript](./src/k-th-symbol-in-grammar/res.js) | Medium | +| NO | [NAME](https://leetcode.com/problems/XXX/) | [TypeScript](./src/XXX/res.ts) | Easy | diff --git a/src/minimum-depth-of-binary-tree/res.ts b/src/minimum-depth-of-binary-tree/res.ts new file mode 100644 index 0000000..8334ba7 --- /dev/null +++ b/src/minimum-depth-of-binary-tree/res.ts @@ -0,0 +1,29 @@ +/** + * Definition for a binary tree node. + */ +class TreeNode { + val: number + left: TreeNode | null + right: TreeNode | null + constructor(val?: number, left?: TreeNode | null, right?: TreeNode | null) { + this.val = (val===undefined ? 0 : val) + this.left = (left===undefined ? null : left) + this.right = (right===undefined ? null : right) + } +} + +function minDepth(root: TreeNode | null): number { + if (!root) { + return 0; + } + + if (!root.left && !root.right) { + return 1; + } + + if (root.left && root.right) { + return Math.min(minDepth(root.left), minDepth((root.right))) + 1; + } else { + return Math.max(minDepth(root.left), minDepth((root.right))) + 1; + } +}; \ No newline at end of file From 70bc41c23d7abab001b376ccb31263bbcd21be96 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Fri, 24 Jun 2022 11:49:38 +0800 Subject: [PATCH 08/53] update: 53 --- README.md | 2 +- src/maximum-subarray/res.ts | 55 +++++++++++++++++++++++++ src/minimum-depth-of-binary-tree/res.ts | 2 +- 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 src/maximum-subarray/res.ts diff --git a/README.md b/README.md index 32703b0..62f49f8 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 46 | [Permutations](https://leetcode.com/problems/permutations/) | [JavaScript](./src/permutations/res.js) | Medium | | 48 | [Rotate Image](https://leetcode.com/problems/rotate-image/) | [JavaScript](./src/rotate-image/res.js) | Medium | | 49 | [Group Anagrams](https://leetcode.com/problems/anagrams/) | [JavaScript](./src/anagrams/res.js) | Medium | -| 53 | [Maximum Subarray](https://leetcode.com/problems/maximum-subarray/) | [JavaScript](./src/maximum-subarray/res.js) | Easy | +| 53 | [Maximum Subarray](https://leetcode.com/problems/maximum-subarray/) | [JavaScript](./src/maximum-subarray/res.js) · [TypeScript](./src/maximum-subarray/res.ts) | Easy | | 54 | [Spiral Matrix](https://leetcode.com/problems/spiral-matrix/) | [JavaScript](./src/spiral-matrix/res.js) | Medium | | 55 | [Jump Game](https://leetcode.com/problems/jump-game/) * | [JavaScript](./src/jump-game/res.js) | Medium | | 56 | [Merge Intervals](https://leetcode.com/problems/merge-intervals/) | [JavaScript](./src/merge-intervals/res.js) | Medium | diff --git a/src/maximum-subarray/res.ts b/src/maximum-subarray/res.ts new file mode 100644 index 0000000..ea56766 --- /dev/null +++ b/src/maximum-subarray/res.ts @@ -0,0 +1,55 @@ +function maxSubArray(nums: number[]): number { + if (nums.length === 0) { + return 0; + } + + if (nums.length === 1) { + return nums[0]; + } + + const maxI = [nums[0]]; + nums.forEach((num, i) => { + if (!i) { + return ; + } + + maxI[i] = Math.max(maxI[i-1]+num, num); + }) + + return Math.max(...maxI); +}; + +function Status(lSum: number, rSum: number, mSum: number, iSum: number) { + return { + lSum, + rSum, + mSum, + iSum, + }; +} + +function getSum(nums: number[], start: number, end: number) { + if (start === end) { + return Status(nums[start], nums[start], nums[start], nums[start]); + } + + const mIndex = Math.floor((start + end) / 2); + const leftSum = getSum(nums, start, mIndex); + const rightSum = getSum(nums, mIndex+1, end); + + return Status( + Math.max(leftSum.lSum, leftSum.iSum + rightSum.lSum), + Math.max(rightSum.rSum, rightSum.iSum + leftSum.rSum), + Math.max(leftSum.mSum, rightSum.mSum, leftSum.rSum + rightSum.lSum), + leftSum.iSum+rightSum.iSum + ) + +} + +/** + * 线段树 + * @param nums + */ +function maxSubArray2(nums: number[]): number { + return getSum(nums, 0, nums.length-1).mSum; +}; \ No newline at end of file diff --git a/src/minimum-depth-of-binary-tree/res.ts b/src/minimum-depth-of-binary-tree/res.ts index 8334ba7..94612ee 100644 --- a/src/minimum-depth-of-binary-tree/res.ts +++ b/src/minimum-depth-of-binary-tree/res.ts @@ -16,7 +16,7 @@ function minDepth(root: TreeNode | null): number { if (!root) { return 0; } - + if (!root.left && !root.right) { return 1; } From aa0b7b358597996ae748f38d3c5d8ca39004951c Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Fri, 24 Jun 2022 12:38:42 +0800 Subject: [PATCH 09/53] update: 64 --- README.md | 1 + src/minimum-path-sum/res.ts | 39 +++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 src/minimum-path-sum/res.ts diff --git a/README.md b/README.md index 62f49f8..34bbadf 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 57 | [Insert Interval](https://leetcode.com/problems/insert-interval/) | [JavaScript](./src/insert-interval/res.js) | Hard | | 62 | [Unique Paths](https://leetcode.com/problems/unique-paths/) | [JavaScript](./src/unique-paths/res.js) | Medium | | 63 | [Unique Paths ii](https://leetcode.com/problems/unique-paths-ii/) | [JavaScript](./src/unique-paths-ii/res.js) | Medium | +| 64 | [minimum-path-sum](https://leetcode.com/problems/minimum-path-sum/) | [TypeScript](./src/minimum-path-sum/res.ts) | Medium | | 66 | [Plus One](https://leetcode.com/problems/plus-one/) | [JavaScript](./src/plus-one/res.js) | Easy | | 69 | [Sqrt(x)](https://leetcode.com/problems/sqrtx/) | [JavaScript](./src/sqrtx/res.js) | Easy | | 71 | [Simplify Path](https://leetcode.com/problems/simplify-path/) | [JavaScript](./src/simplify-path/res.js) | Medium | diff --git a/src/minimum-path-sum/res.ts b/src/minimum-path-sum/res.ts new file mode 100644 index 0000000..2037fc9 --- /dev/null +++ b/src/minimum-path-sum/res.ts @@ -0,0 +1,39 @@ +function minPathSum(grid: number[][]): number { + const pathCache: number[][] = []; + + function calculate(m:number, n:number): number { + if (m === 0 && n === 0) { + return pathCache[0][0]; + } + + if (m === 0) { + pathCache[m][n] = (!!pathCache[m][n-1] ? pathCache[m][n-1] : calculate(m,n-1)) + grid[m][n]; + } else if (n === 0) { + pathCache[m][n] = (!!pathCache[m-1][n] ? pathCache[m-1][n] : calculate(m-1,n)) + grid[m][n]; + } else { + pathCache[m][n] = Math.min( + (!!pathCache[m-1][n] ? pathCache[m-1][n] : calculate(m-1,n)) + grid[m][n], + (!!pathCache[m][n-1] ? pathCache[m][n-1] : calculate(m,n-1)) + grid[m][n], + ) + } + + return pathCache[m][n]; + } + + const rowLength = grid.length; + const columnLength = grid[0]?.length; + + for (let i = 0; i < rowLength; i++) { + pathCache.push([]); + for (let j = 0; j < columnLength; j++) { + pathCache[i].push(0); + } + } + pathCache[0][0] = grid[0][0]; + + if (!rowLength || !columnLength) { + return 0; + } + + return calculate(rowLength-1, columnLength-1); +}; \ No newline at end of file From 0eaedc245ba01a87d92ecbf4599a85eee3737209 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Fri, 24 Jun 2022 14:37:35 +0800 Subject: [PATCH 10/53] update: 70 --- README.md | 1 + src/climbing-stairs/res.ts | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 src/climbing-stairs/res.ts diff --git a/README.md b/README.md index 34bbadf..8ad0a61 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 64 | [minimum-path-sum](https://leetcode.com/problems/minimum-path-sum/) | [TypeScript](./src/minimum-path-sum/res.ts) | Medium | | 66 | [Plus One](https://leetcode.com/problems/plus-one/) | [JavaScript](./src/plus-one/res.js) | Easy | | 69 | [Sqrt(x)](https://leetcode.com/problems/sqrtx/) | [JavaScript](./src/sqrtx/res.js) | Easy | +| 70 | [climbing-stairs](https://leetcode.com/problems/climbing-stairs/) | [TypeScript](./src/climbing-stairs/res.ts) | Easy | | 71 | [Simplify Path](https://leetcode.com/problems/simplify-path/) | [JavaScript](./src/simplify-path/res.js) | Medium | | 73 | [Set Matrix Zeroes](https://leetcode.com/problems/set-matrix-zeroes/) | [JavaScript](./src/set-matrix-zeroes/res.js) | Medium | | 75 | [Sort Colors](https://leetcode.com/problems/sort-colors/) | [JavaScript](./src/sort-colors/res.js) | Medium | diff --git a/src/climbing-stairs/res.ts b/src/climbing-stairs/res.ts new file mode 100644 index 0000000..38f3e77 --- /dev/null +++ b/src/climbing-stairs/res.ts @@ -0,0 +1,13 @@ +function climbStairs(n: number): number { + if (n === 0) { + return 0; + } + + const stairsCache = [1, 2]; + + for (let i = 2; i < n; i++) { + stairsCache[i] = stairsCache[i-1] + stairsCache[i-2]; + } + + return stairsCache[n-1]; +}; \ No newline at end of file From 9390bfdb65f4f9a90e13d4bd539359fda2cd4818 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Fri, 24 Jun 2022 15:25:43 +0800 Subject: [PATCH 11/53] update: 96 --- README.md | 1 + src/unique-binary-search-trees/res.ts | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 src/unique-binary-search-trees/res.ts diff --git a/README.md b/README.md index 8ad0a61..1bbdd13 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 91 | [Decode Ways](https://leetcode.com/problems/decode-ways/) | [JavaScript](./src/decode-ways/res.js) | Medium | | 93 | [Restore IP Addresses](https://leetcode.com/problems/restore-ip-addresses/) | [JavaScript](./src/restore-ip-addresses/res.js) | Medium | | 94 | [Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal/) | [TypeScript](./src/binary-tree-inorder-traversal/res.ts) | Easy | +| 96 | [unique-binary-search-trees](https://leetcode.com/problems/unique-binary-search-trees/) | [TypeScript](./src/unique-binary-search-trees/res.ts) | Medium | | 98 | [Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/) | [JavaScript](./src/validate-binary-search-tree/res.js) | Medium | | 100 | [Same Tree](https://leetcode.com/problems/same-tree/) | [JavaScript](./src/same-tree/res.js) | Easy | | 101 | [Symmetric Tree](https://leetcode.com/problems/symmetric-tree/) | [JavaScript](./src/symmetric-tree/res.js) | Easy | diff --git a/src/unique-binary-search-trees/res.ts b/src/unique-binary-search-trees/res.ts new file mode 100644 index 0000000..2d1b08c --- /dev/null +++ b/src/unique-binary-search-trees/res.ts @@ -0,0 +1,13 @@ +function numTrees(n: number): number { + const calculateCache = new Array(n+1).fill(0); + calculateCache[0] = 1; + calculateCache[1] = 1; + + for (let i=2; i<=n; i++) { + for (let j = 0; j <= i-1; j++) { + calculateCache[i] += calculateCache[i-j-1] * calculateCache[j]; + } + } + + return calculateCache[n]; +}; \ No newline at end of file From 59c1236001170bee4dd95257ad6464f296218fa8 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Fri, 24 Jun 2022 15:48:09 +0800 Subject: [PATCH 12/53] update: 97 --- README.md | 1 + src/interleaving-string/res.ts | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 src/interleaving-string/res.ts diff --git a/README.md b/README.md index 1bbdd13..fd531b3 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 93 | [Restore IP Addresses](https://leetcode.com/problems/restore-ip-addresses/) | [JavaScript](./src/restore-ip-addresses/res.js) | Medium | | 94 | [Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal/) | [TypeScript](./src/binary-tree-inorder-traversal/res.ts) | Easy | | 96 | [unique-binary-search-trees](https://leetcode.com/problems/unique-binary-search-trees/) | [TypeScript](./src/unique-binary-search-trees/res.ts) | Medium | +| 97 | [interleaving-string](https://leetcode.com/problems/interleaving-string/) | [TypeScript](./src/interleaving-string/res.ts) | Medium | | 98 | [Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/) | [JavaScript](./src/validate-binary-search-tree/res.js) | Medium | | 100 | [Same Tree](https://leetcode.com/problems/same-tree/) | [JavaScript](./src/same-tree/res.js) | Easy | | 101 | [Symmetric Tree](https://leetcode.com/problems/symmetric-tree/) | [JavaScript](./src/symmetric-tree/res.js) | Easy | diff --git a/src/interleaving-string/res.ts b/src/interleaving-string/res.ts new file mode 100644 index 0000000..afe7d8d --- /dev/null +++ b/src/interleaving-string/res.ts @@ -0,0 +1,25 @@ +function isInterleave(s1: string, s2: string, s3: string): boolean { + if (s3.length !== (s2.length+s1.length)) { + return false; + } + + if (s3.length == 1) { + return s3 === s2 || s1 === s3; + } else if (s3.length === 0) { + return s1 === s2 && s1 === ''; + } + + const lastS1 = s1[s1.length-1]; + const lastS2 = s2[s2.length-1]; + const lastS3 = s3[s3.length-1]; + + if (lastS3 === lastS1 && isInterleave(s1.slice(0,-1), s2, s3.slice(0,-1), )) { + return true; + } + + if (lastS3 === lastS2 && isInterleave(s1, s2.slice(0,-1), s3.slice(0,-1), )) { + return true; + } + + return false; +}; \ No newline at end of file From 3918d8e0a0e8b0229822cccd1de70d9285d752b3 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Fri, 24 Jun 2022 18:39:19 +0800 Subject: [PATCH 13/53] update: 131 --- README.md | 1 + src/palindrome-partitioning/res.ts | 36 ++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 src/palindrome-partitioning/res.ts diff --git a/README.md b/README.md index fd531b3..0652539 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 127 | [Word Ladder](https://leetcode.com/problems/word-ladder/) | [JavaScript](./src/word-ladder/res.js) | Medium | | 128 | [Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence/) | [JavaScript](./src/longest-consecutive-sequence/res.js) | Medium | | 130 | [Surrounded Regions](https://leetcode.com/problems/surrounded-regions/) | [JavaScript](./src/surrounded-regions/res.js) | Medium | +| 131 | [palindrome-partitioning](https://leetcode.com/problems/palindrome-partitioning/) | [TypeScript](./src/palindrome-partitioning/res.ts) | Medium | | 133 | [Clone Graph](https://leetcode.com/problems/clone-graph/) | [JavaScript](./src/clone-graph/res.js) | Medium | | 134 | [Gas Station](https://leetcode.com/problems/gas-station/) | [JavaScript](./src/gas-station/res.js) | Medium | | 135 | [Candy](https://leetcode.com/problems/candy/) | [JavaScript](./src/candy/res.js) | Hard | diff --git a/src/palindrome-partitioning/res.ts b/src/palindrome-partitioning/res.ts new file mode 100644 index 0000000..ea751e1 --- /dev/null +++ b/src/palindrome-partitioning/res.ts @@ -0,0 +1,36 @@ +function partition(s: string): string[][] { + const result = []; + let answers = []; + + const dfs = (i:number) => { + if (i === s.length) { + result.push(answers.slice()); + return ; + } + + for (let j = i; j < s.length; j++) { + if (reverseCache[i][j]) { + answers.push(s.slice(i, j+1)); + dfs(j+1); + answers.pop(); + } + } + } + + const reverseCache = new Array(s.length).fill([]).map(() => new Array(s.length).fill(true)); + for (let i = reverseCache.length; i >= 0; i--) { + for (let j = i; j < reverseCache.length; j++) { + if (i === j) { + reverseCache[i][j] = true; + } else if (i + 1 === j) { + reverseCache[i][j] = s[i] === s[j]; + } else { + reverseCache[i][j] = reverseCache[i+1][j-1] && s[i] === s[j]; + } + } + } + + dfs(0); + + return result; +}; \ No newline at end of file From c6c73f2fdd4baf0985cf9c17429533a11c288968 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Sat, 25 Jun 2022 15:41:04 +0800 Subject: [PATCH 14/53] update: 139 --- README.md | 1 + src/word-break/res.ts | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 src/word-break/res.ts diff --git a/README.md b/README.md index 0652539..16c332b 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 135 | [Candy](https://leetcode.com/problems/candy/) | [JavaScript](./src/candy/res.js) | Hard | | 136 | [Single Number](https://leetcode.com/problems/single-number/) | [JavaScript](./src/single-number/res.js) | Easy | | 137 | [Single Number II](https://leetcode.com/problems/single-number-ii/) | [JavaScript](./src/single-number-ii/res.js) | Medium | +| 139 | [word-break](https://leetcode.com/problems/word-break/) | [TypeScript](./src/word-break/res.ts) | Medium | | 151 | [Reverse Words in a String](https://leetcode.com/problems/reverse-words-in-a-string/) | [JavaScript](./src/reverse-words-in-a-string/res.js) | Medium | | 152 | [Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray/) | [JavaScript](./src/maximum-product-subarray/res.js) | Medium | | 153 | [Find Minimum in Rotated Sorted Array](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/) | [JavaScript](./src/find-minimum-in-rotated-sorted-array/res.js) | Medium | diff --git a/src/word-break/res.ts b/src/word-break/res.ts new file mode 100644 index 0000000..62692b3 --- /dev/null +++ b/src/word-break/res.ts @@ -0,0 +1,18 @@ +function wordBreak(s: string, wordDict: string[]): boolean { + if (!s) { + return true; + } + const n = s.length; + const dp = new Array(n+1).fill(false); + dp[0] = true; + + for (let i = 0; i < n; i++) { + for (let j = i+1; j <= n+1; j++) { + if (dp[i] && wordDict.includes(s.slice(i, j))) { + dp[j] = true; + } + } + } + + return dp[n]; +}; \ No newline at end of file From c0b901ccdd8da1ec4ec50329871d5aa8d799aa70 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Sat, 25 Jun 2022 15:53:42 +0800 Subject: [PATCH 15/53] update: integrated with eslint and tsconfig --- .eslintrc.js | 19 + .gitignore | 27 +- package-lock.json | 4158 ++++++++++++++++++++++++++++ package.json | 29 + src/palindrome-partitioning/res.ts | 4 +- tsconfig.json | 103 + 6 files changed, 4337 insertions(+), 3 deletions(-) create mode 100644 .eslintrc.js create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 tsconfig.json diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..cf8b122 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,19 @@ +module.exports = { + env: { + browser: true, + es2021: true, + }, + extends: [ + 'airbnb-base', + ], + parser: '@typescript-eslint/parser', + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + }, + plugins: [ + '@typescript-eslint', + ], + rules: { + }, +}; diff --git a/.gitignore b/.gitignore index bc8a670..fcdeb4e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,26 @@ -.idea/* \ No newline at end of file +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# production +/build + +# misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# IDE +/.idea diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..2f2cf84 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,4158 @@ +{ + "name": "leetcode-with-javascript", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "leetcode-with-javascript", + "version": "1.0.0", + "license": "MIT", + "devDependencies": { + "@typescript-eslint/eslint-plugin": "^5.29.0", + "@typescript-eslint/parser": "^5.29.0", + "eslint": "^8.18.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-plugin-import": "^2.26.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "1.3.0", + "resolved": "https://mirrors.tencent.com/npm/@eslint%2feslintrc/-/eslintrc-1.3.0.tgz", + "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.3.2", + "globals": "^13.15.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.9.5", + "resolved": "https://mirrors.tencent.com/npm/@humanwhocodes%2fconfig-array/-/config-array-0.9.5.tgz", + "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://mirrors.tencent.com/npm/@humanwhocodes%2fobject-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://mirrors.tencent.com/npm/@nodelib%2ffs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://mirrors.tencent.com/npm/@nodelib%2ffs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://mirrors.tencent.com/npm/@nodelib%2ffs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@types/json-schema": { + "version": "7.0.11", + "resolved": "https://mirrors.tencent.com/npm/@types%2fjson-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://mirrors.tencent.com/npm/@types%2fjson5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true, + "license": "MIT" + }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "5.29.0", + "resolved": "https://mirrors.tencent.com/npm/@typescript-eslint%2feslint-plugin/-/eslint-plugin-5.29.0.tgz", + "integrity": "sha512-kgTsISt9pM53yRFQmLZ4npj99yGl3x3Pl7z4eA66OuTzAGC4bQB5H5fuLwPnqTKU3yyrrg4MIhjF17UYnL4c0w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "5.29.0", + "@typescript-eslint/type-utils": "5.29.0", + "@typescript-eslint/utils": "5.29.0", + "debug": "^4.3.4", + "functional-red-black-tree": "^1.0.1", + "ignore": "^5.2.0", + "regexpp": "^3.2.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "5.29.0", + "resolved": "https://mirrors.tencent.com/npm/@typescript-eslint%2fparser/-/parser-5.29.0.tgz", + "integrity": "sha512-ruKWTv+x0OOxbzIw9nW5oWlUopvP/IQDjB5ZqmTglLIoDTctLlAJpAQFpNPJP/ZI7hTT9sARBosEfaKbcFuECw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/scope-manager": "5.29.0", + "@typescript-eslint/types": "5.29.0", + "@typescript-eslint/typescript-estree": "5.29.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "5.29.0", + "resolved": "https://mirrors.tencent.com/npm/@typescript-eslint%2fscope-manager/-/scope-manager-5.29.0.tgz", + "integrity": "sha512-etbXUT0FygFi2ihcxDZjz21LtC+Eps9V2xVx09zFoN44RRHPrkMflidGMI+2dUs821zR1tDS6Oc9IXxIjOUZwA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "5.29.0", + "@typescript-eslint/visitor-keys": "5.29.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "5.29.0", + "resolved": "https://mirrors.tencent.com/npm/@typescript-eslint%2ftype-utils/-/type-utils-5.29.0.tgz", + "integrity": "sha512-JK6bAaaiJozbox3K220VRfCzLa9n0ib/J+FHIwnaV3Enw/TO267qe0pM1b1QrrEuy6xun374XEAsRlA86JJnyg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/utils": "5.29.0", + "debug": "^4.3.4", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "5.29.0", + "resolved": "https://mirrors.tencent.com/npm/@typescript-eslint%2ftypes/-/types-5.29.0.tgz", + "integrity": "sha512-X99VbqvAXOMdVyfFmksMy3u8p8yoRGITgU1joBJPzeYa0rhdf5ok9S56/itRoUSh99fiDoMtarSIJXo7H/SnOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "5.29.0", + "resolved": "https://mirrors.tencent.com/npm/@typescript-eslint%2ftypescript-estree/-/typescript-estree-5.29.0.tgz", + "integrity": "sha512-mQvSUJ/JjGBdvo+1LwC+GY2XmSYjK1nAaVw2emp/E61wEVYEyibRHCqm1I1vEKbXCpUKuW4G7u9ZCaZhJbLoNQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "@typescript-eslint/types": "5.29.0", + "@typescript-eslint/visitor-keys": "5.29.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "5.29.0", + "resolved": "https://mirrors.tencent.com/npm/@typescript-eslint%2futils/-/utils-5.29.0.tgz", + "integrity": "sha512-3Eos6uP1nyLOBayc/VUdKZikV90HahXE5Dx9L5YlSd/7ylQPXhLk1BYb29SDgnBnTp+jmSZUU0QxUiyHgW4p7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.29.0", + "@typescript-eslint/types": "5.29.0", + "@typescript-eslint/typescript-estree": "5.29.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://mirrors.tencent.com/npm/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@typescript-eslint/utils/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://mirrors.tencent.com/npm/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.29.0", + "resolved": "https://mirrors.tencent.com/npm/@typescript-eslint%2fvisitor-keys/-/visitor-keys-5.29.0.tgz", + "integrity": "sha512-Hpb/mCWsjILvikMQoZIE3voc9wtQcS0A9FUw3h8bhr9UxBdtI/tw1ZDZUOXHXLOVMedKCH5NxyzATwnU78bWCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "5.29.0", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/acorn": { + "version": "8.7.1", + "resolved": "https://mirrors.tencent.com/npm/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://mirrors.tencent.com/npm/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://mirrors.tencent.com/npm/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://mirrors.tencent.com/npm/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://mirrors.tencent.com/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://mirrors.tencent.com/npm/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/array-includes": { + "version": "3.1.5", + "resolved": "https://mirrors.tencent.com/npm/array-includes/-/array-includes-3.1.5.tgz", + "integrity": "sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5", + "get-intrinsic": "^1.1.1", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://mirrors.tencent.com/npm/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.0", + "resolved": "https://mirrors.tencent.com/npm/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz", + "integrity": "sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.2", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://mirrors.tencent.com/npm/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://mirrors.tencent.com/npm/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://mirrors.tencent.com/npm/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://mirrors.tencent.com/npm/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://mirrors.tencent.com/npm/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://mirrors.tencent.com/npm/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://mirrors.tencent.com/npm/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://mirrors.tencent.com/npm/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://mirrors.tencent.com/npm/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true, + "license": "MIT" + }, + "node_modules/confusing-browser-globals": { + "version": "1.0.11", + "resolved": "https://mirrors.tencent.com/npm/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz", + "integrity": "sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://mirrors.tencent.com/npm/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://mirrors.tencent.com/npm/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://mirrors.tencent.com/npm/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/define-properties": { + "version": "1.1.4", + "resolved": "https://mirrors.tencent.com/npm/define-properties/-/define-properties-1.1.4.tgz", + "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://mirrors.tencent.com/npm/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://mirrors.tencent.com/npm/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/es-abstract": { + "version": "1.20.1", + "resolved": "https://mirrors.tencent.com/npm/es-abstract/-/es-abstract-1.20.1.tgz", + "integrity": "sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "function.prototype.name": "^1.1.5", + "get-intrinsic": "^1.1.1", + "get-symbol-description": "^1.0.0", + "has": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.3", + "is-callable": "^1.2.4", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "regexp.prototype.flags": "^1.4.3", + "string.prototype.trimend": "^1.0.5", + "string.prototype.trimstart": "^1.0.5", + "unbox-primitive": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://mirrors.tencent.com/npm/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "has": "^1.0.3" + } + }, + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://mirrors.tencent.com/npm/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://mirrors.tencent.com/npm/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.18.0", + "resolved": "https://mirrors.tencent.com/npm/eslint/-/eslint-8.18.0.tgz", + "integrity": "sha512-As1EfFMVk7Xc6/CvhssHUjsAQSkpfXvUGMFC3ce8JDe6WvqCgRrLOBQbVpsBFr1X1V+RACOadnzVvcUS5ni2bA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint/eslintrc": "^1.3.0", + "@humanwhocodes/config-array": "^0.9.2", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.3.2", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^6.0.1", + "globals": "^13.15.0", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-config-airbnb-base": { + "version": "15.0.0", + "resolved": "https://mirrors.tencent.com/npm/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz", + "integrity": "sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==", + "dev": true, + "license": "MIT", + "dependencies": { + "confusing-browser-globals": "^1.0.10", + "object.assign": "^4.1.2", + "object.entries": "^1.1.5", + "semver": "^6.3.0" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + }, + "peerDependencies": { + "eslint": "^7.32.0 || ^8.2.0", + "eslint-plugin-import": "^2.25.2" + } + }, + "node_modules/eslint-config-airbnb-base/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://mirrors.tencent.com/npm/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-import-resolver-node": { + "version": "0.3.6", + "resolved": "https://mirrors.tencent.com/npm/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", + "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.2.7", + "resolve": "^1.20.0" + } + }, + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://mirrors.tencent.com/npm/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-module-utils": { + "version": "2.7.3", + "resolved": "https://mirrors.tencent.com/npm/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz", + "integrity": "sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.2.7", + "find-up": "^2.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://mirrors.tencent.com/npm/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.26.0", + "resolved": "https://mirrors.tencent.com/npm/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", + "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-includes": "^3.1.4", + "array.prototype.flat": "^1.2.5", + "debug": "^2.6.9", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-module-utils": "^2.7.3", + "has": "^1.0.3", + "is-core-module": "^2.8.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.values": "^1.1.5", + "resolve": "^1.22.0", + "tsconfig-paths": "^3.14.1" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://mirrors.tencent.com/npm/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://mirrors.tencent.com/npm/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://mirrors.tencent.com/npm/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true, + "license": "MIT" + }, + "node_modules/eslint-scope": { + "version": "7.1.1", + "resolved": "https://mirrors.tencent.com/npm/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://mirrors.tencent.com/npm/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://mirrors.tencent.com/npm/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://mirrors.tencent.com/npm/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/espree": { + "version": "9.3.2", + "resolved": "https://mirrors.tencent.com/npm/espree/-/espree-9.3.2.tgz", + "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.7.1", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/esquery": { + "version": "1.4.0", + "resolved": "https://mirrors.tencent.com/npm/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://mirrors.tencent.com/npm/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://mirrors.tencent.com/npm/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://mirrors.tencent.com/npm/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://mirrors.tencent.com/npm/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-glob": { + "version": "3.2.11", + "resolved": "https://mirrors.tencent.com/npm/fast-glob/-/fast-glob-3.2.11.tgz", + "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-glob/node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://mirrors.tencent.com/npm/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://mirrors.tencent.com/npm/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://mirrors.tencent.com/npm/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true, + "license": "MIT" + }, + "node_modules/fastq": { + "version": "1.13.0", + "resolved": "https://mirrors.tencent.com/npm/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, + "license": "ISC", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://mirrors.tencent.com/npm/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://mirrors.tencent.com/npm/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "2.1.0", + "resolved": "https://mirrors.tencent.com/npm/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://mirrors.tencent.com/npm/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.5", + "resolved": "https://mirrors.tencent.com/npm/flatted/-/flatted-3.2.5.tgz", + "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", + "dev": true, + "license": "ISC" + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://mirrors.tencent.com/npm/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true, + "license": "ISC" + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://mirrors.tencent.com/npm/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true, + "license": "MIT" + }, + "node_modules/function.prototype.name": { + "version": "1.1.5", + "resolved": "https://mirrors.tencent.com/npm/function.prototype.name/-/function.prototype.name-1.1.5.tgz", + "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://mirrors.tencent.com/npm/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true, + "license": "MIT" + }, + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://mirrors.tencent.com/npm/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.1.2", + "resolved": "https://mirrors.tencent.com/npm/get-intrinsic/-/get-intrinsic-1.1.2.tgz", + "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-symbol-description": { + "version": "1.0.0", + "resolved": "https://mirrors.tencent.com/npm/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://mirrors.tencent.com/npm/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://mirrors.tencent.com/npm/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "13.15.0", + "resolved": "https://mirrors.tencent.com/npm/globals/-/globals-13.15.0.tgz", + "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://mirrors.tencent.com/npm/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://mirrors.tencent.com/npm/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://mirrors.tencent.com/npm/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://mirrors.tencent.com/npm/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://mirrors.tencent.com/npm/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://mirrors.tencent.com/npm/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://mirrors.tencent.com/npm/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ignore": { + "version": "5.2.0", + "resolved": "https://mirrors.tencent.com/npm/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://mirrors.tencent.com/npm/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://mirrors.tencent.com/npm/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://mirrors.tencent.com/npm/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://mirrors.tencent.com/npm/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/internal-slot": { + "version": "1.0.3", + "resolved": "https://mirrors.tencent.com/npm/internal-slot/-/internal-slot-1.0.3.tgz", + "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.1.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://mirrors.tencent.com/npm/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-bigints": "^1.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://mirrors.tencent.com/npm/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-callable": { + "version": "1.2.4", + "resolved": "https://mirrors.tencent.com/npm/is-callable/-/is-callable-1.2.4.tgz", + "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-core-module": { + "version": "2.9.0", + "resolved": "https://mirrors.tencent.com/npm/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "dev": true, + "license": "MIT", + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://mirrors.tencent.com/npm/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://mirrors.tencent.com/npm/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://mirrors.tencent.com/npm/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-negative-zero": { + "version": "2.0.2", + "resolved": "https://mirrors.tencent.com/npm/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://mirrors.tencent.com/npm/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://mirrors.tencent.com/npm/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://mirrors.tencent.com/npm/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.2", + "resolved": "https://mirrors.tencent.com/npm/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://mirrors.tencent.com/npm/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://mirrors.tencent.com/npm/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://mirrors.tencent.com/npm/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://mirrors.tencent.com/npm/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true, + "license": "ISC" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://mirrors.tencent.com/npm/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://mirrors.tencent.com/npm/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://mirrors.tencent.com/npm/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true, + "license": "MIT" + }, + "node_modules/json5": { + "version": "1.0.1", + "resolved": "https://mirrors.tencent.com/npm/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://mirrors.tencent.com/npm/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "2.0.0", + "resolved": "https://mirrors.tencent.com/npm/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://mirrors.tencent.com/npm/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://mirrors.tencent.com/npm/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://mirrors.tencent.com/npm/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://mirrors.tencent.com/npm/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "license": "MIT", + "dependencies": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://mirrors.tencent.com/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.6", + "resolved": "https://mirrors.tencent.com/npm/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://mirrors.tencent.com/npm/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://mirrors.tencent.com/npm/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true, + "license": "MIT" + }, + "node_modules/object-inspect": { + "version": "1.12.2", + "resolved": "https://mirrors.tencent.com/npm/object-inspect/-/object-inspect-1.12.2.tgz", + "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://mirrors.tencent.com/npm/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.assign": { + "version": "4.1.2", + "resolved": "https://mirrors.tencent.com/npm/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/object.entries": { + "version": "1.1.5", + "resolved": "https://mirrors.tencent.com/npm/object.entries/-/object.entries-1.1.5.tgz", + "integrity": "sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.values": { + "version": "1.1.5", + "resolved": "https://mirrors.tencent.com/npm/object.values/-/object.values-1.1.5.tgz", + "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://mirrors.tencent.com/npm/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.1", + "resolved": "https://mirrors.tencent.com/npm/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "1.3.0", + "resolved": "https://mirrors.tencent.com/npm/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-locate": { + "version": "2.0.0", + "resolved": "https://mirrors.tencent.com/npm/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-try": { + "version": "1.0.0", + "resolved": "https://mirrors.tencent.com/npm/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://mirrors.tencent.com/npm/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://mirrors.tencent.com/npm/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://mirrors.tencent.com/npm/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://mirrors.tencent.com/npm/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://mirrors.tencent.com/npm/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://mirrors.tencent.com/npm/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://mirrors.tencent.com/npm/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://mirrors.tencent.com/npm/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://mirrors.tencent.com/npm/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://mirrors.tencent.com/npm/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/regexp.prototype.flags": { + "version": "1.4.3", + "resolved": "https://mirrors.tencent.com/npm/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", + "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "functions-have-names": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/regexpp": { + "version": "3.2.0", + "resolved": "https://mirrors.tencent.com/npm/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/resolve": { + "version": "1.22.1", + "resolved": "https://mirrors.tencent.com/npm/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://mirrors.tencent.com/npm/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://mirrors.tencent.com/npm/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "license": "MIT", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://mirrors.tencent.com/npm/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://mirrors.tencent.com/npm/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/semver": { + "version": "7.3.7", + "resolved": "https://mirrors.tencent.com/npm/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "dev": true, + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://mirrors.tencent.com/npm/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://mirrors.tencent.com/npm/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://mirrors.tencent.com/npm/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://mirrors.tencent.com/npm/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/string.prototype.trimend": { + "version": "1.0.5", + "resolved": "https://mirrors.tencent.com/npm/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", + "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.trimstart": { + "version": "1.0.5", + "resolved": "https://mirrors.tencent.com/npm/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", + "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://mirrors.tencent.com/npm/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://mirrors.tencent.com/npm/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://mirrors.tencent.com/npm/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://mirrors.tencent.com/npm/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://mirrors.tencent.com/npm/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://mirrors.tencent.com/npm/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true, + "license": "MIT" + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://mirrors.tencent.com/npm/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tsconfig-paths": { + "version": "3.14.1", + "resolved": "https://mirrors.tencent.com/npm/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", + "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://mirrors.tencent.com/npm/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true, + "license": "0BSD" + }, + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://mirrors.tencent.com/npm/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" + } + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://mirrors.tencent.com/npm/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://mirrors.tencent.com/npm/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typescript": { + "version": "4.7.4", + "resolved": "https://mirrors.tencent.com/npm/typescript/-/typescript-4.7.4.tgz", + "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://mirrors.tencent.com/npm/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://mirrors.tencent.com/npm/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://mirrors.tencent.com/npm/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true, + "license": "MIT" + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://mirrors.tencent.com/npm/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://mirrors.tencent.com/npm/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://mirrors.tencent.com/npm/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://mirrors.tencent.com/npm/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true, + "license": "ISC" + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://mirrors.tencent.com/npm/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true, + "license": "ISC" + } + }, + "dependencies": { + "@eslint/eslintrc": { + "version": "1.3.0", + "resolved": "https://mirrors.tencent.com/npm/@eslint%2feslintrc/-/eslintrc-1.3.0.tgz", + "integrity": "sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.3.2", + "globals": "^13.15.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + } + }, + "@humanwhocodes/config-array": { + "version": "0.9.5", + "resolved": "https://mirrors.tencent.com/npm/@humanwhocodes%2fconfig-array/-/config-array-0.9.5.tgz", + "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + } + }, + "@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://mirrors.tencent.com/npm/@humanwhocodes%2fobject-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://mirrors.tencent.com/npm/@nodelib%2ffs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://mirrors.tencent.com/npm/@nodelib%2ffs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://mirrors.tencent.com/npm/@nodelib%2ffs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "@types/json-schema": { + "version": "7.0.11", + "resolved": "https://mirrors.tencent.com/npm/@types%2fjson-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "dev": true + }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://mirrors.tencent.com/npm/@types%2fjson5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, + "@typescript-eslint/eslint-plugin": { + "version": "5.29.0", + "resolved": "https://mirrors.tencent.com/npm/@typescript-eslint%2feslint-plugin/-/eslint-plugin-5.29.0.tgz", + "integrity": "sha512-kgTsISt9pM53yRFQmLZ4npj99yGl3x3Pl7z4eA66OuTzAGC4bQB5H5fuLwPnqTKU3yyrrg4MIhjF17UYnL4c0w==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "5.29.0", + "@typescript-eslint/type-utils": "5.29.0", + "@typescript-eslint/utils": "5.29.0", + "debug": "^4.3.4", + "functional-red-black-tree": "^1.0.1", + "ignore": "^5.2.0", + "regexpp": "^3.2.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/parser": { + "version": "5.29.0", + "resolved": "https://mirrors.tencent.com/npm/@typescript-eslint%2fparser/-/parser-5.29.0.tgz", + "integrity": "sha512-ruKWTv+x0OOxbzIw9nW5oWlUopvP/IQDjB5ZqmTglLIoDTctLlAJpAQFpNPJP/ZI7hTT9sARBosEfaKbcFuECw==", + "dev": true, + "requires": { + "@typescript-eslint/scope-manager": "5.29.0", + "@typescript-eslint/types": "5.29.0", + "@typescript-eslint/typescript-estree": "5.29.0", + "debug": "^4.3.4" + } + }, + "@typescript-eslint/scope-manager": { + "version": "5.29.0", + "resolved": "https://mirrors.tencent.com/npm/@typescript-eslint%2fscope-manager/-/scope-manager-5.29.0.tgz", + "integrity": "sha512-etbXUT0FygFi2ihcxDZjz21LtC+Eps9V2xVx09zFoN44RRHPrkMflidGMI+2dUs821zR1tDS6Oc9IXxIjOUZwA==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.29.0", + "@typescript-eslint/visitor-keys": "5.29.0" + } + }, + "@typescript-eslint/type-utils": { + "version": "5.29.0", + "resolved": "https://mirrors.tencent.com/npm/@typescript-eslint%2ftype-utils/-/type-utils-5.29.0.tgz", + "integrity": "sha512-JK6bAaaiJozbox3K220VRfCzLa9n0ib/J+FHIwnaV3Enw/TO267qe0pM1b1QrrEuy6xun374XEAsRlA86JJnyg==", + "dev": true, + "requires": { + "@typescript-eslint/utils": "5.29.0", + "debug": "^4.3.4", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/types": { + "version": "5.29.0", + "resolved": "https://mirrors.tencent.com/npm/@typescript-eslint%2ftypes/-/types-5.29.0.tgz", + "integrity": "sha512-X99VbqvAXOMdVyfFmksMy3u8p8yoRGITgU1joBJPzeYa0rhdf5ok9S56/itRoUSh99fiDoMtarSIJXo7H/SnOg==", + "dev": true + }, + "@typescript-eslint/typescript-estree": { + "version": "5.29.0", + "resolved": "https://mirrors.tencent.com/npm/@typescript-eslint%2ftypescript-estree/-/typescript-estree-5.29.0.tgz", + "integrity": "sha512-mQvSUJ/JjGBdvo+1LwC+GY2XmSYjK1nAaVw2emp/E61wEVYEyibRHCqm1I1vEKbXCpUKuW4G7u9ZCaZhJbLoNQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.29.0", + "@typescript-eslint/visitor-keys": "5.29.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/utils": { + "version": "5.29.0", + "resolved": "https://mirrors.tencent.com/npm/@typescript-eslint%2futils/-/utils-5.29.0.tgz", + "integrity": "sha512-3Eos6uP1nyLOBayc/VUdKZikV90HahXE5Dx9L5YlSd/7ylQPXhLk1BYb29SDgnBnTp+jmSZUU0QxUiyHgW4p7A==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.29.0", + "@typescript-eslint/types": "5.29.0", + "@typescript-eslint/typescript-estree": "5.29.0", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "dependencies": { + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://mirrors.tencent.com/npm/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://mirrors.tencent.com/npm/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + } + } + }, + "@typescript-eslint/visitor-keys": { + "version": "5.29.0", + "resolved": "https://mirrors.tencent.com/npm/@typescript-eslint%2fvisitor-keys/-/visitor-keys-5.29.0.tgz", + "integrity": "sha512-Hpb/mCWsjILvikMQoZIE3voc9wtQcS0A9FUw3h8bhr9UxBdtI/tw1ZDZUOXHXLOVMedKCH5NxyzATwnU78bWCQ==", + "dev": true, + "requires": { + "@typescript-eslint/types": "5.29.0", + "eslint-visitor-keys": "^3.3.0" + } + }, + "acorn": { + "version": "8.7.1", + "resolved": "https://mirrors.tencent.com/npm/acorn/-/acorn-8.7.1.tgz", + "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://mirrors.tencent.com/npm/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "requires": {} + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://mirrors.tencent.com/npm/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://mirrors.tencent.com/npm/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://mirrors.tencent.com/npm/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://mirrors.tencent.com/npm/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "array-includes": { + "version": "3.1.5", + "resolved": "https://mirrors.tencent.com/npm/array-includes/-/array-includes-3.1.5.tgz", + "integrity": "sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5", + "get-intrinsic": "^1.1.1", + "is-string": "^1.0.7" + } + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://mirrors.tencent.com/npm/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "array.prototype.flat": { + "version": "1.3.0", + "resolved": "https://mirrors.tencent.com/npm/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz", + "integrity": "sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.2", + "es-shim-unscopables": "^1.0.0" + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://mirrors.tencent.com/npm/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://mirrors.tencent.com/npm/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://mirrors.tencent.com/npm/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "call-bind": { + "version": "1.0.2", + "resolved": "https://mirrors.tencent.com/npm/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://mirrors.tencent.com/npm/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://mirrors.tencent.com/npm/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://mirrors.tencent.com/npm/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://mirrors.tencent.com/npm/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://mirrors.tencent.com/npm/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "confusing-browser-globals": { + "version": "1.0.11", + "resolved": "https://mirrors.tencent.com/npm/confusing-browser-globals/-/confusing-browser-globals-1.0.11.tgz", + "integrity": "sha512-JsPKdmh8ZkmnHxDk55FZ1TqVLvEQTvoByJZRN9jzI0UjxK/QgAmsphz7PGtqgPieQZ/CQcHWXCR7ATDNhGe+YA==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://mirrors.tencent.com/npm/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "debug": { + "version": "4.3.4", + "resolved": "https://mirrors.tencent.com/npm/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "deep-is": { + "version": "0.1.4", + "resolved": "https://mirrors.tencent.com/npm/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "define-properties": { + "version": "1.1.4", + "resolved": "https://mirrors.tencent.com/npm/define-properties/-/define-properties-1.1.4.tgz", + "integrity": "sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==", + "dev": true, + "requires": { + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" + } + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://mirrors.tencent.com/npm/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + } + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://mirrors.tencent.com/npm/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "es-abstract": { + "version": "1.20.1", + "resolved": "https://mirrors.tencent.com/npm/es-abstract/-/es-abstract-1.20.1.tgz", + "integrity": "sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "function.prototype.name": "^1.1.5", + "get-intrinsic": "^1.1.1", + "get-symbol-description": "^1.0.0", + "has": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.3", + "is-callable": "^1.2.4", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.2", + "regexp.prototype.flags": "^1.4.3", + "string.prototype.trimend": "^1.0.5", + "string.prototype.trimstart": "^1.0.5", + "unbox-primitive": "^1.0.2" + } + }, + "es-shim-unscopables": { + "version": "1.0.0", + "resolved": "https://mirrors.tencent.com/npm/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://mirrors.tencent.com/npm/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://mirrors.tencent.com/npm/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "eslint": { + "version": "8.18.0", + "resolved": "https://mirrors.tencent.com/npm/eslint/-/eslint-8.18.0.tgz", + "integrity": "sha512-As1EfFMVk7Xc6/CvhssHUjsAQSkpfXvUGMFC3ce8JDe6WvqCgRrLOBQbVpsBFr1X1V+RACOadnzVvcUS5ni2bA==", + "dev": true, + "requires": { + "@eslint/eslintrc": "^1.3.0", + "@humanwhocodes/config-array": "^0.9.2", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.3.2", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^6.0.1", + "globals": "^13.15.0", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + } + }, + "eslint-config-airbnb-base": { + "version": "15.0.0", + "resolved": "https://mirrors.tencent.com/npm/eslint-config-airbnb-base/-/eslint-config-airbnb-base-15.0.0.tgz", + "integrity": "sha512-xaX3z4ZZIcFLvh2oUNvcX5oEofXda7giYmuplVxoOg5A7EXJMrUyqRgR+mhDhPK8LZ4PttFOBvCYDbX3sUoUig==", + "dev": true, + "requires": { + "confusing-browser-globals": "^1.0.10", + "object.assign": "^4.1.2", + "object.entries": "^1.1.5", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://mirrors.tencent.com/npm/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "eslint-import-resolver-node": { + "version": "0.3.6", + "resolved": "https://mirrors.tencent.com/npm/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", + "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", + "dev": true, + "requires": { + "debug": "^3.2.7", + "resolve": "^1.20.0" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://mirrors.tencent.com/npm/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "eslint-module-utils": { + "version": "2.7.3", + "resolved": "https://mirrors.tencent.com/npm/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz", + "integrity": "sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==", + "dev": true, + "requires": { + "debug": "^3.2.7", + "find-up": "^2.1.0" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://mirrors.tencent.com/npm/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + } + } + }, + "eslint-plugin-import": { + "version": "2.26.0", + "resolved": "https://mirrors.tencent.com/npm/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz", + "integrity": "sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==", + "dev": true, + "requires": { + "array-includes": "^3.1.4", + "array.prototype.flat": "^1.2.5", + "debug": "^2.6.9", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-module-utils": "^2.7.3", + "has": "^1.0.3", + "is-core-module": "^2.8.1", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.values": "^1.1.5", + "resolve": "^1.22.0", + "tsconfig-paths": "^3.14.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://mirrors.tencent.com/npm/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "doctrine": { + "version": "2.1.0", + "resolved": "https://mirrors.tencent.com/npm/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://mirrors.tencent.com/npm/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "eslint-scope": { + "version": "7.1.1", + "resolved": "https://mirrors.tencent.com/npm/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + } + }, + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://mirrors.tencent.com/npm/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://mirrors.tencent.com/npm/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + } + } + }, + "eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://mirrors.tencent.com/npm/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "dev": true + }, + "espree": { + "version": "9.3.2", + "resolved": "https://mirrors.tencent.com/npm/espree/-/espree-9.3.2.tgz", + "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", + "dev": true, + "requires": { + "acorn": "^8.7.1", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" + } + }, + "esquery": { + "version": "1.4.0", + "resolved": "https://mirrors.tencent.com/npm/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://mirrors.tencent.com/npm/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + } + }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://mirrors.tencent.com/npm/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://mirrors.tencent.com/npm/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://mirrors.tencent.com/npm/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-glob": { + "version": "3.2.11", + "resolved": "https://mirrors.tencent.com/npm/fast-glob/-/fast-glob-3.2.11.tgz", + "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "dependencies": { + "glob-parent": { + "version": "5.1.2", + "resolved": "https://mirrors.tencent.com/npm/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + } + } + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://mirrors.tencent.com/npm/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://mirrors.tencent.com/npm/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fastq": { + "version": "1.13.0", + "resolved": "https://mirrors.tencent.com/npm/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://mirrors.tencent.com/npm/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://mirrors.tencent.com/npm/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://mirrors.tencent.com/npm/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://mirrors.tencent.com/npm/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + } + }, + "flatted": { + "version": "3.2.5", + "resolved": "https://mirrors.tencent.com/npm/flatted/-/flatted-3.2.5.tgz", + "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://mirrors.tencent.com/npm/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://mirrors.tencent.com/npm/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "function.prototype.name": { + "version": "1.1.5", + "resolved": "https://mirrors.tencent.com/npm/function.prototype.name/-/function.prototype.name-1.1.5.tgz", + "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" + } + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://mirrors.tencent.com/npm/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "functions-have-names": { + "version": "1.2.3", + "resolved": "https://mirrors.tencent.com/npm/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true + }, + "get-intrinsic": { + "version": "1.1.2", + "resolved": "https://mirrors.tencent.com/npm/get-intrinsic/-/get-intrinsic-1.1.2.tgz", + "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", + "dev": true, + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.3" + } + }, + "get-symbol-description": { + "version": "1.0.0", + "resolved": "https://mirrors.tencent.com/npm/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + } + }, + "glob": { + "version": "7.2.3", + "resolved": "https://mirrors.tencent.com/npm/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "6.0.2", + "resolved": "https://mirrors.tencent.com/npm/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "requires": { + "is-glob": "^4.0.3" + } + }, + "globals": { + "version": "13.15.0", + "resolved": "https://mirrors.tencent.com/npm/globals/-/globals-13.15.0.tgz", + "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "globby": { + "version": "11.1.0", + "resolved": "https://mirrors.tencent.com/npm/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://mirrors.tencent.com/npm/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-bigints": { + "version": "1.0.2", + "resolved": "https://mirrors.tencent.com/npm/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://mirrors.tencent.com/npm/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://mirrors.tencent.com/npm/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.1" + } + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://mirrors.tencent.com/npm/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true + }, + "has-tostringtag": { + "version": "1.0.0", + "resolved": "https://mirrors.tencent.com/npm/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.2" + } + }, + "ignore": { + "version": "5.2.0", + "resolved": "https://mirrors.tencent.com/npm/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://mirrors.tencent.com/npm/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://mirrors.tencent.com/npm/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://mirrors.tencent.com/npm/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://mirrors.tencent.com/npm/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "internal-slot": { + "version": "1.0.3", + "resolved": "https://mirrors.tencent.com/npm/internal-slot/-/internal-slot-1.0.3.tgz", + "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "dev": true, + "requires": { + "get-intrinsic": "^1.1.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + } + }, + "is-bigint": { + "version": "1.0.4", + "resolved": "https://mirrors.tencent.com/npm/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "requires": { + "has-bigints": "^1.0.1" + } + }, + "is-boolean-object": { + "version": "1.1.2", + "resolved": "https://mirrors.tencent.com/npm/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-callable": { + "version": "1.2.4", + "resolved": "https://mirrors.tencent.com/npm/is-callable/-/is-callable-1.2.4.tgz", + "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==", + "dev": true + }, + "is-core-module": { + "version": "2.9.0", + "resolved": "https://mirrors.tencent.com/npm/is-core-module/-/is-core-module-2.9.0.tgz", + "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, + "is-date-object": { + "version": "1.0.5", + "resolved": "https://mirrors.tencent.com/npm/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://mirrors.tencent.com/npm/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://mirrors.tencent.com/npm/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-negative-zero": { + "version": "2.0.2", + "resolved": "https://mirrors.tencent.com/npm/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://mirrors.tencent.com/npm/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-number-object": { + "version": "1.0.7", + "resolved": "https://mirrors.tencent.com/npm/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-regex": { + "version": "1.1.4", + "resolved": "https://mirrors.tencent.com/npm/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + } + }, + "is-shared-array-buffer": { + "version": "1.0.2", + "resolved": "https://mirrors.tencent.com/npm/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2" + } + }, + "is-string": { + "version": "1.0.7", + "resolved": "https://mirrors.tencent.com/npm/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "dev": true, + "requires": { + "has-tostringtag": "^1.0.0" + } + }, + "is-symbol": { + "version": "1.0.4", + "resolved": "https://mirrors.tencent.com/npm/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, + "requires": { + "has-symbols": "^1.0.2" + } + }, + "is-weakref": { + "version": "1.0.2", + "resolved": "https://mirrors.tencent.com/npm/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.2" + } + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://mirrors.tencent.com/npm/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://mirrors.tencent.com/npm/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://mirrors.tencent.com/npm/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://mirrors.tencent.com/npm/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json5": { + "version": "1.0.1", + "resolved": "https://mirrors.tencent.com/npm/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + }, + "levn": { + "version": "0.4.1", + "resolved": "https://mirrors.tencent.com/npm/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://mirrors.tencent.com/npm/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://mirrors.tencent.com/npm/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://mirrors.tencent.com/npm/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://mirrors.tencent.com/npm/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://mirrors.tencent.com/npm/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://mirrors.tencent.com/npm/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.6", + "resolved": "https://mirrors.tencent.com/npm/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://mirrors.tencent.com/npm/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://mirrors.tencent.com/npm/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "object-inspect": { + "version": "1.12.2", + "resolved": "https://mirrors.tencent.com/npm/object-inspect/-/object-inspect-1.12.2.tgz", + "integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==", + "dev": true + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://mirrors.tencent.com/npm/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://mirrors.tencent.com/npm/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + } + }, + "object.entries": { + "version": "1.1.5", + "resolved": "https://mirrors.tencent.com/npm/object.entries/-/object.entries-1.1.5.tgz", + "integrity": "sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + } + }, + "object.values": { + "version": "1.1.5", + "resolved": "https://mirrors.tencent.com/npm/object.values/-/object.values-1.1.5.tgz", + "integrity": "sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://mirrors.tencent.com/npm/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://mirrors.tencent.com/npm/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://mirrors.tencent.com/npm/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://mirrors.tencent.com/npm/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://mirrors.tencent.com/npm/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://mirrors.tencent.com/npm/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://mirrors.tencent.com/npm/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://mirrors.tencent.com/npm/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://mirrors.tencent.com/npm/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://mirrors.tencent.com/npm/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://mirrors.tencent.com/npm/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://mirrors.tencent.com/npm/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://mirrors.tencent.com/npm/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://mirrors.tencent.com/npm/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://mirrors.tencent.com/npm/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, + "regexp.prototype.flags": { + "version": "1.4.3", + "resolved": "https://mirrors.tencent.com/npm/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz", + "integrity": "sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "functions-have-names": "^1.2.2" + } + }, + "regexpp": { + "version": "3.2.0", + "resolved": "https://mirrors.tencent.com/npm/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true + }, + "resolve": { + "version": "1.22.1", + "resolved": "https://mirrors.tencent.com/npm/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", + "dev": true, + "requires": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://mirrors.tencent.com/npm/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://mirrors.tencent.com/npm/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://mirrors.tencent.com/npm/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://mirrors.tencent.com/npm/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "semver": { + "version": "7.3.7", + "resolved": "https://mirrors.tencent.com/npm/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://mirrors.tencent.com/npm/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://mirrors.tencent.com/npm/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "side-channel": { + "version": "1.0.4", + "resolved": "https://mirrors.tencent.com/npm/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", + "dev": true, + "requires": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://mirrors.tencent.com/npm/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "string.prototype.trimend": { + "version": "1.0.5", + "resolved": "https://mirrors.tencent.com/npm/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz", + "integrity": "sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" + } + }, + "string.prototype.trimstart": { + "version": "1.0.5", + "resolved": "https://mirrors.tencent.com/npm/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz", + "integrity": "sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://mirrors.tencent.com/npm/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://mirrors.tencent.com/npm/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://mirrors.tencent.com/npm/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://mirrors.tencent.com/npm/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://mirrors.tencent.com/npm/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://mirrors.tencent.com/npm/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://mirrors.tencent.com/npm/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "tsconfig-paths": { + "version": "3.14.1", + "resolved": "https://mirrors.tencent.com/npm/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", + "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" + } + }, + "tslib": { + "version": "1.14.1", + "resolved": "https://mirrors.tencent.com/npm/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "tsutils": { + "version": "3.21.0", + "resolved": "https://mirrors.tencent.com/npm/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://mirrors.tencent.com/npm/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://mirrors.tencent.com/npm/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + }, + "typescript": { + "version": "4.7.4", + "resolved": "https://mirrors.tencent.com/npm/typescript/-/typescript-4.7.4.tgz", + "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", + "dev": true, + "peer": true + }, + "unbox-primitive": { + "version": "1.0.2", + "resolved": "https://mirrors.tencent.com/npm/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", + "dev": true, + "requires": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + } + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://mirrors.tencent.com/npm/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://mirrors.tencent.com/npm/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://mirrors.tencent.com/npm/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://mirrors.tencent.com/npm/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "requires": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + } + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://mirrors.tencent.com/npm/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://mirrors.tencent.com/npm/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://mirrors.tencent.com/npm/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..b8bd7f3 --- /dev/null +++ b/package.json @@ -0,0 +1,29 @@ +{ + "name": "leetcode-with-javascript", + "version": "1.0.0", + "description": "Solutions collection of my LeetCode submissions in JavaScript (LeetCode 解题集之 JavaScript 版)", + "main": "index.js", + "scripts": { + "fix": "eslint --fix" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/hijiangtao/LeetCode-with-JavaScript.git" + }, + "keywords": [ + "leetcode" + ], + "author": "hijiangtao", + "license": "MIT", + "bugs": { + "url": "https://github.com/hijiangtao/LeetCode-with-JavaScript/issues" + }, + "homepage": "https://github.com/hijiangtao/LeetCode-with-JavaScript#readme", + "devDependencies": { + "@typescript-eslint/eslint-plugin": "^5.29.0", + "@typescript-eslint/parser": "^5.29.0", + "eslint": "^8.18.0", + "eslint-config-airbnb-base": "^15.0.0", + "eslint-plugin-import": "^2.26.0" + } +} diff --git a/src/palindrome-partitioning/res.ts b/src/palindrome-partitioning/res.ts index ea751e1..1818761 100644 --- a/src/palindrome-partitioning/res.ts +++ b/src/palindrome-partitioning/res.ts @@ -1,6 +1,6 @@ function partition(s: string): string[][] { - const result = []; - let answers = []; + const result: string[][] = []; + let answers: string[] = []; const dfs = (i:number) => { if (i === s.length) { diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..75dcaea --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,103 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + // "outDir": "./", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + } +} From cf62e5c7a9654de37e6999185c1018daadfcc19f Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Sat, 25 Jun 2022 16:09:40 +0800 Subject: [PATCH 16/53] update: 240 --- README.md | 2 +- src/search-a-2d-matrix-ii/res.ts | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/search-a-2d-matrix-ii/res.ts diff --git a/README.md b/README.md index 16c332b..4dce736 100644 --- a/README.md +++ b/README.md @@ -119,7 +119,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 228 | [Summary Ranges](https://leetcode.com/problems/summary-ranges/solution/) | [JavaScript](./src/summary-ranges/res.js) | Medium | | 238 | [Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/solution/) | [JavaScript](./src/product-of-array-except-self/res.js) | Medium | | 239 | [Sliding Window Maximum](https://leetcode.com/problems/sliding-window-maximum/description/) | [JavaScript](./src/sliding-window-maximum/description/res.js) | Hard | -| 240 | [Search a 2D Matrix II](https://leetcode.com/problems/search-a-2d-matrix-ii/) | [JavaScript](./src/search-a-2d-matrix-ii/res.js) | Medium | +| 240 | [Search a 2D Matrix II](https://leetcode.com/problems/search-a-2d-matrix-ii/) | [JavaScript](./src/search-a-2d-matrix-ii/res.js) · [TypeScript](./src/search-a-2d-matrix-ii/res.ts) | Medium | | 274 | [H-Index](https://leetcode.com/problems/h-index/) | [JavaScript](./src/h-index/res.js) | Medium | | 275 | [H-Index II](https://leetcode.com/problems/h-index-ii/) | [JavaScript](./src/h-index-ii/res.js) | Medium | | 278 | [First Bad Version](https://leetcode.com/problems/first-bad-version/) | [JavaScript](./src/first-bad-version/res.js) | Easy | diff --git a/src/search-a-2d-matrix-ii/res.ts b/src/search-a-2d-matrix-ii/res.ts new file mode 100644 index 0000000..100f270 --- /dev/null +++ b/src/search-a-2d-matrix-ii/res.ts @@ -0,0 +1,32 @@ +function searchMatrix(matrix: number[][], target: number): boolean { + const visitedMatrix: boolean[][] = []; + + if (!matrix.length) { + return false; + } + + const rowLength = matrix.length; + const columnLength = matrix[0].length; + + for (let i = 0; i < rowLength; i++) { + visitedMatrix.push([]); + for (let j = 0; j < columnLength; j++) { + visitedMatrix[i].push(false); + } + } + + const dfs = (i:number, j:number): boolean => { + if (matrix[i][j] > target || visitedMatrix[i][j]) { + return false; + } + + visitedMatrix[i][j] = true; + if (matrix[i][j] === target) { + return true; + } else { + return i < (rowLength - 1) && dfs(i+1, j) || j < (columnLength - 1) && dfs(i, j + 1); + } + } + + return dfs(0, 0); +}; \ No newline at end of file From d34ae34ac99fcca33ea61b1233a24cd40ed244c3 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Sat, 25 Jun 2022 19:11:00 +0800 Subject: [PATCH 17/53] update: 148 --- README.md | 1 + src/sort-list/res.ts | 65 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 src/sort-list/res.ts diff --git a/README.md b/README.md index 4dce736..f01980a 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 136 | [Single Number](https://leetcode.com/problems/single-number/) | [JavaScript](./src/single-number/res.js) | Easy | | 137 | [Single Number II](https://leetcode.com/problems/single-number-ii/) | [JavaScript](./src/single-number-ii/res.js) | Medium | | 139 | [word-break](https://leetcode.com/problems/word-break/) | [TypeScript](./src/word-break/res.ts) | Medium | +| 148 | [sort-list](https://leetcode.com/problems/sort-list/) | [TypeScript](./src/sort-list/res.ts) | Medium | | 151 | [Reverse Words in a String](https://leetcode.com/problems/reverse-words-in-a-string/) | [JavaScript](./src/reverse-words-in-a-string/res.js) | Medium | | 152 | [Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray/) | [JavaScript](./src/maximum-product-subarray/res.js) | Medium | | 153 | [Find Minimum in Rotated Sorted Array](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/) | [JavaScript](./src/find-minimum-in-rotated-sorted-array/res.js) | Medium | diff --git a/src/sort-list/res.ts b/src/sort-list/res.ts new file mode 100644 index 0000000..d4db8d4 --- /dev/null +++ b/src/sort-list/res.ts @@ -0,0 +1,65 @@ +/** + * Definition for singly-linked list. + */ +class ListNode { + val: number + next: ListNode | null + constructor(val?: number, next?: ListNode | null) { + this.val = (val===undefined ? 0 : val) + this.next = (next===undefined ? null : next) + } +} + +function merge(start: ListNode | null, end: ListNode | null): ListNode | null { + let result: ListNode | null = new ListNode(0); + let resultPoint = result; + while (start && end) { + if (start.val > end.val) { + resultPoint.next = end; + end = end.next; + } else { + resultPoint.next = start; + start = start.next; + } + + resultPoint = resultPoint.next; + } + + if (start) { + resultPoint.next = start; + } else { + resultPoint.next = end; + } + + return result.next; +} + +function sortWithRange(start: ListNode | null, end: ListNode | null): ListNode | null { + if (!start) { + return start; + } + if (start.next === end) { + start.next = null; + return start; + } + + let midPoint: ListNode | null = start; + let endPoint: ListNode | null = start; + while(endPoint !== end) { + midPoint = midPoint?.next; + endPoint = endPoint?.next; + + if (endPoint !== end) { + endPoint = endPoint?.next; + } + } + + const leftNode = sortWithRange(start, midPoint); + const rightNode = sortWithRange(midPoint, end); + + return merge(leftNode, rightNode); +} + +function sortList(head: ListNode | null): ListNode | null { + return sortWithRange(head, null); +}; \ No newline at end of file From d55c6022af39bd6decebac7bfb3d82c064939ddb Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Mon, 27 Jun 2022 12:44:07 +0800 Subject: [PATCH 18/53] update: 134 --- README.md | 2 +- src/gas-station/res.ts | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 src/gas-station/res.ts diff --git a/README.md b/README.md index f01980a..128da15 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 130 | [Surrounded Regions](https://leetcode.com/problems/surrounded-regions/) | [JavaScript](./src/surrounded-regions/res.js) | Medium | | 131 | [palindrome-partitioning](https://leetcode.com/problems/palindrome-partitioning/) | [TypeScript](./src/palindrome-partitioning/res.ts) | Medium | | 133 | [Clone Graph](https://leetcode.com/problems/clone-graph/) | [JavaScript](./src/clone-graph/res.js) | Medium | -| 134 | [Gas Station](https://leetcode.com/problems/gas-station/) | [JavaScript](./src/gas-station/res.js) | Medium | +| 134 | [Gas Station](https://leetcode.com/problems/gas-station/) | [JavaScript](./src/gas-station/res.js) · [TypeScript](./src/gas-station/res.ts) | Medium | | 135 | [Candy](https://leetcode.com/problems/candy/) | [JavaScript](./src/candy/res.js) | Hard | | 136 | [Single Number](https://leetcode.com/problems/single-number/) | [JavaScript](./src/single-number/res.js) | Easy | | 137 | [Single Number II](https://leetcode.com/problems/single-number-ii/) | [JavaScript](./src/single-number-ii/res.js) | Medium | diff --git a/src/gas-station/res.ts b/src/gas-station/res.ts new file mode 100644 index 0000000..4c8f1fd --- /dev/null +++ b/src/gas-station/res.ts @@ -0,0 +1,29 @@ +function canCompleteCircuit(gas: number[], cost: number[]): number { + const rest = gas.map((gasItem, i) => gasItem - cost[i]); + let remain = 0; + let startIndex = 0; + + if (rest.reduce((p,c) => p+c, 0) < 0) { + return -1; + } + + let count = rest.length; + for (let i = 0; ; ) { + if (remain + rest[i] < 0) { + remain = 0; + i = (i+1) % rest.length; + startIndex = i; + count =rest.length; + } else { + remain += rest[i]; + i = (i+1) % rest.length; + count--; + + if (!count && remain >= 0) { + break; + } + } + } + + return startIndex; +}; \ No newline at end of file From 5ce54e609f66f416fbdbf6a93bc233ed73a2347e Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Mon, 27 Jun 2022 13:18:28 +0800 Subject: [PATCH 19/53] update: 179 --- README.md | 1 + src/largest-number/res.ts | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 src/largest-number/res.ts diff --git a/README.md b/README.md index 128da15..5c1e51c 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 175 | [Combine Two Tables](https://leetcode.com/problems/combine-two-tables/) | [SQL](./src/combine-two-tables/res.txt) | Easy | | 176 | [Second Highest Salary](https://leetcode.com/problems/second-highest-salary/) | [SQL](./src/second-highest-salary/res.txt) | Easy | | 177 | [Nth Highest Salary](https://leetcode.com/problems/nth-highest-salary/) | [SQL](./src/nth-highest-salary/res.txt) | Medium | +| 179 | [largest-number](https://leetcode.com/problems/largest-number/) | [TypeScript](./src/largest-number/res.ts) | Medium | | 181 | [Employees Earning More Than Their Managers](https://leetcode.com/problems/employees-earning-more-than-their-managers/) | [SQL](./src/employees-earning-more-than-their-managers/res.txt) | Easy | | 182 | [Duplicate Emails](https://leetcode.com/problems/duplicate-emails/) | [SQL](./src/duplicate-emails/res.txt) | Easy | | 183 | [Customers Who Never Order](https://leetcode.com/problems/customers-who-never-order/) | [SQL](./src/customers-who-never-order/res.txt) | Easy | diff --git a/src/largest-number/res.ts b/src/largest-number/res.ts new file mode 100644 index 0000000..d3ff481 --- /dev/null +++ b/src/largest-number/res.ts @@ -0,0 +1,10 @@ +function largestNumber(nums: number[]): string { + const stringNums = nums.map(n=>n.toString()); + + stringNums.sort((a,b) => b+a > a+b ? 1: -1); + const result = stringNums.join(''); + + if (result.indexOf('0') === 0) return '0'; + + return result; +}; \ No newline at end of file From 0ac110bc178d3a0c7c55144ad5c905aef8c8f1e3 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Mon, 27 Jun 2022 13:19:34 +0800 Subject: [PATCH 20/53] update: README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5c1e51c..28806c1 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr **ATTENTION**: If you also use JavaScript as your coding language, you should pay attention to some JavaScript INTERNAL issues, such as bitwise operators, so as to let you not drop into some trouble which may be caused by JavaScript itself. -**Progress: 127 Solutions** +**Progress: 152 Solutions** | ID | Title | Solution | Difficulty | |-----|-------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|------------| From 86d2f0f26cabd49b3073f5849dc149af096e3b3f Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Mon, 27 Jun 2022 16:09:09 +0800 Subject: [PATCH 21/53] update: 316 --- README.md | 1 + src/remove-duplicate-letters/res.ts | 51 +++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 src/remove-duplicate-letters/res.ts diff --git a/README.md b/README.md index 28806c1..f4d33e6 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 309 | [Best Time to Buy and Sell Stock with Cooldown](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-with-cooldown/res.js) | Medium | | 310 | [Minimum Height Trees](https://leetcode.com/problems/minimum-height-trees/) | [JavaScript](./src/minimum-height-trees/res.js) | Medium | | 315 | [Count of Smaller Numbers After Self](https://leetcode.com/problems/count-of-smaller-numbers-after-self/) * | [JavaScript](./src/count-of-smaller-numbers-after-self/res.js) | Hard | +| 316 | [remove-duplicate-letters](https://leetcode.com/problems/remove-duplicate-letters/) | [TypeScript](./src/remove-duplicate-letters/res.ts) | Medium | | 322 | [Coin Change](https://leetcode.com/problems/coin-change/) | [JavaScript](./src/coin-change/res.js) | Medium | | 327 | [Count of Range Sum](https://leetcode.com/problems/count-of-range-sum/) | [JavaScript](./src/count-of-range-sum/res.js) | Hard | | 334 | [Increasing Triplet Subsequence](https://leetcode.com/problems/increasing-triplet-subsequence/) | [JavaScript](./src/increasing-triplet-subsequence/res.js) | Medium | diff --git a/src/remove-duplicate-letters/res.ts b/src/remove-duplicate-letters/res.ts new file mode 100644 index 0000000..53e867b --- /dev/null +++ b/src/remove-duplicate-letters/res.ts @@ -0,0 +1,51 @@ +function removeDuplicateLetters(s: string): string { + if (s.length <= 1) { + return s; + } + + const sList = s.split(''); + const sCountMap: { [key in string]: number } = {}; + sList.map(str => { + sCountMap[str] = sCountMap[str] ? sCountMap[str]+1 : 1; + }); + + const remainCountMap: { [key in string]: number } = JSON.parse(JSON.stringify(sCountMap)); + const resultCountMap: { [key in string]: number } = {}; + + Object.keys(sCountMap).forEach(key => resultCountMap[key] = 0); + const sStack = [sList[0]]; + resultCountMap[sList[0]] = 1; + remainCountMap[sList[0]] -= 1; + + for (let i = 1; i < sList.length; i++) { + const element = sList[i]; + const prevElement = sStack[sStack.length-1]; + if (!resultCountMap[element] && element > prevElement) { + sStack.push(element); + remainCountMap[element] -= 1; + resultCountMap[element] = 1; + } else if (!resultCountMap[element] && element < prevElement) { + let currentIndex = sStack.length-1; + while(currentIndex >= 0) { + const currentPrevElement = sStack[currentIndex]; + if (currentPrevElement > element && remainCountMap[currentPrevElement]) { + currentIndex--; + } else { + break; + } + } + const sStackLength = sStack.length; + for (let j = currentIndex+1; j < sStackLength; j++) { + const minusElement = sStack.pop() as string; + resultCountMap[minusElement]--; + } + sStack.push(element); + remainCountMap[element]--; + resultCountMap[element]++; + } else { + remainCountMap[element]--; + } + } + + return sStack.join(''); +}; \ No newline at end of file From 5e328d7b70e0ffa796f7217776cf0af3928ebf2d Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Mon, 27 Jun 2022 16:32:47 +0800 Subject: [PATCH 22/53] update: 316 --- src/increasing-triplet-subsequence/res.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/increasing-triplet-subsequence/res.ts diff --git a/src/increasing-triplet-subsequence/res.ts b/src/increasing-triplet-subsequence/res.ts new file mode 100644 index 0000000..e69de29 From 1f233e66e1e8abd7fb44ad6da558fa8e64a72cef Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Mon, 27 Jun 2022 16:32:52 +0800 Subject: [PATCH 23/53] update: 334 --- README.md | 312 +++++++++++----------- src/increasing-triplet-subsequence/res.ts | 28 ++ 2 files changed, 184 insertions(+), 156 deletions(-) diff --git a/README.md b/README.md index f4d33e6..336888a 100644 --- a/README.md +++ b/README.md @@ -6,159 +6,159 @@ This is the solutions collection of my LeetCode submissions, most of them are pr **Progress: 152 Solutions** -| ID | Title | Solution | Difficulty | -|-----|-------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|------------| -| 1 | [Two Sum](https://leetcode.com/problems/two-sum/) | [JavaScript](./src/two-sum/res.js) | Easy | -| 2 | [Add Two Numbers](https://leetcode.com/problems/add-two-numbers/) | [JavaScript](./src/add-two-numbers/res.js) | Medium | -| 3 | [Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | [JavaScript](./src/longest-substring-without-repeating-characters/res.js) | Medium | -| 4 | [Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/) | [JavaScript](./src/median-of-two-sorted-arrays/res.js) | Hard | -| 5 | [Longest Palindromic Substring](https://leetcode.com/problems/longest-palindromic-substring/) | [JavaScript](./src/longest-palindromic-substring/res.js) | Medium | -| 6 | [ZigZag Conversion](https://leetcode.com/problems/zigzag-conversion/) | [JavaScript](./src/zigzag-conversion/res.js) | Medium | -| 7 | [Reverse Integer](https://leetcode.com/problems/reverse-integer/) | [JavaScript](./src/reverse-integer/res.js) | Easy | -| 8 | [String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi/) | [JavaScript](./src/string-to-integer-atoi/res.js) | Medium | -| 11 | [Container With Most Water](https://leetcode.com/problems/container-with-most-water/) | [JavaScript](./src/container-with-most-water/res.js) | Medium | -| 13 | [Roman to Integer](https://leetcode.com/problems/roman-to-integer/) | [JavaScript](./src/roman-to-integer/res.js) | Easy | -| 14 | [Longest Common Prefix](https://leetcode.com/problems/longest-common-prefix/) | [JavaScript](./src/longest-common-prefix/res.js) | Easy | -| 15 | [3Sum](https://leetcode.com/problems/3sum/) | [JavaScript](./src/3sum/res.js) | Medium | -| 16 | [3Sum Closest](https://leetcode.com/problems/3sum-closest/) | [JavaScript](./src/3sum-closest/res.js) | Medium | -| 17 | [Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/) | [JavaScript](./src/letter-combinations-of-a-phone-number/res.js) | Medium | -| 19 | [Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) | [JavaScript](./src/remove-nth-node-from-end-of-list/res.js) | Medium | -| 22 | [Generate Parentheses](https://leetcode.com/problems/generate-parentheses/) | [JavaScript](./src/generate-parentheses/res.js) | Medium | -| 26 | [Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/) | [JavaScript](./src/remove-duplicates-from-sorted-array/res.js) | Easy | -| 27 | [Remove Element](https://leetcode.com/problems/remove-element/) | [JavaScript](./src/remove-element/res.js) | Easy | -| 28 | [Implement strStr()](https://leetcode.com/problems/implement-strstr/) | [JavaScript](./src/implement-strstr/res.js) | Easy | -| 29 | [Divide Two Integers](https://leetcode.com/problems/divide-two-integers/) | [JavaScript](./src/divide-two-integers/res.js) | Medium | -| 33 | [Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/) | [JavaScript](./src/search-in-rotated-sorted-array/res.js) | Medium | -| 34 | [Search for a Range](https://leetcode.com/problems/search-for-a-range/) | [JavaScript](./src/search-for-a-range/res.js) | Medium | -| 35 | [Search Insert Position](https://leetcode.com/problems/search-insert-position/) | [JavaScript](./src/search-insert-position/res.js) | Easy | -| 39 | [Combination Sum](https://leetcode.com/problems/combination-sum/) | [JavaScript](./src/combination-sum/res.js) | Medium | -| 40 | [Combination Sum II](https://leetcode.com/problems/combination-sum-ii/) | [JavaScript](./src/combination-sum-ii/res.js) | Medium | -| 41 | [First Missing Positive](https://leetcode.com/problems/first-missing-positive/description/) | [JavaScript](./src/first-missing-positive/res.js) | Hard | -| 42 | [ Trapping Rain Water](https://leetcode.com/problems/trapping-rain-water/description/) | [JavaScript](./src/trapping-rain-water/res.js) | Hard | -| 43 | [Multiply Strings](https://leetcode.com/problems/multiply-strings/) | [JavaScript](./src/multiply-strings/res.js) | Medium | -| 45 | [Jump Game II](https://leetcode.com/problems/jump-game-ii/) | [JavaScript](./src/jump-game-ii/res.js) | Hard | -| 46 | [Permutations](https://leetcode.com/problems/permutations/) | [JavaScript](./src/permutations/res.js) | Medium | -| 48 | [Rotate Image](https://leetcode.com/problems/rotate-image/) | [JavaScript](./src/rotate-image/res.js) | Medium | -| 49 | [Group Anagrams](https://leetcode.com/problems/anagrams/) | [JavaScript](./src/anagrams/res.js) | Medium | -| 53 | [Maximum Subarray](https://leetcode.com/problems/maximum-subarray/) | [JavaScript](./src/maximum-subarray/res.js) · [TypeScript](./src/maximum-subarray/res.ts) | Easy | -| 54 | [Spiral Matrix](https://leetcode.com/problems/spiral-matrix/) | [JavaScript](./src/spiral-matrix/res.js) | Medium | -| 55 | [Jump Game](https://leetcode.com/problems/jump-game/) * | [JavaScript](./src/jump-game/res.js) | Medium | -| 56 | [Merge Intervals](https://leetcode.com/problems/merge-intervals/) | [JavaScript](./src/merge-intervals/res.js) | Medium | -| 57 | [Insert Interval](https://leetcode.com/problems/insert-interval/) | [JavaScript](./src/insert-interval/res.js) | Hard | -| 62 | [Unique Paths](https://leetcode.com/problems/unique-paths/) | [JavaScript](./src/unique-paths/res.js) | Medium | -| 63 | [Unique Paths ii](https://leetcode.com/problems/unique-paths-ii/) | [JavaScript](./src/unique-paths-ii/res.js) | Medium | -| 64 | [minimum-path-sum](https://leetcode.com/problems/minimum-path-sum/) | [TypeScript](./src/minimum-path-sum/res.ts) | Medium | -| 66 | [Plus One](https://leetcode.com/problems/plus-one/) | [JavaScript](./src/plus-one/res.js) | Easy | -| 69 | [Sqrt(x)](https://leetcode.com/problems/sqrtx/) | [JavaScript](./src/sqrtx/res.js) | Easy | -| 70 | [climbing-stairs](https://leetcode.com/problems/climbing-stairs/) | [TypeScript](./src/climbing-stairs/res.ts) | Easy | -| 71 | [Simplify Path](https://leetcode.com/problems/simplify-path/) | [JavaScript](./src/simplify-path/res.js) | Medium | -| 73 | [Set Matrix Zeroes](https://leetcode.com/problems/set-matrix-zeroes/) | [JavaScript](./src/set-matrix-zeroes/res.js) | Medium | -| 75 | [Sort Colors](https://leetcode.com/problems/sort-colors/) | [JavaScript](./src/sort-colors/res.js) | Medium | -| 80 | [Remove Duplicates from Sorted Array II](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/) | [JavaScript](./src/remove-duplicates-from-sorted-array-ii/res.js) | Medium | -| 81 | [Search in Rotated Sorted Array II](https://leetcode.com/problems/search-in-rotated-sorted-array-ii/) | [JavaScript](./src/search-in-rotated-sorted-array-ii/res.js) | Medium | -| 88 | [ Merge Sorted Array](https://leetcode.com/problems/merge-sorted-array/) | [JavaScript](./src/merge-sorted-array/res.js) | Medium | -| 91 | [Decode Ways](https://leetcode.com/problems/decode-ways/) | [JavaScript](./src/decode-ways/res.js) | Medium | -| 93 | [Restore IP Addresses](https://leetcode.com/problems/restore-ip-addresses/) | [JavaScript](./src/restore-ip-addresses/res.js) | Medium | -| 94 | [Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal/) | [TypeScript](./src/binary-tree-inorder-traversal/res.ts) | Easy | -| 96 | [unique-binary-search-trees](https://leetcode.com/problems/unique-binary-search-trees/) | [TypeScript](./src/unique-binary-search-trees/res.ts) | Medium | -| 97 | [interleaving-string](https://leetcode.com/problems/interleaving-string/) | [TypeScript](./src/interleaving-string/res.ts) | Medium | -| 98 | [Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/) | [JavaScript](./src/validate-binary-search-tree/res.js) | Medium | -| 100 | [Same Tree](https://leetcode.com/problems/same-tree/) | [JavaScript](./src/same-tree/res.js) | Easy | -| 101 | [Symmetric Tree](https://leetcode.com/problems/symmetric-tree/) | [JavaScript](./src/symmetric-tree/res.js) | Easy | -| 102 | [Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/) | [JavaScript](./src/binary-tree-level-order-traversal/res.js) | Medium | -| 103 | [binary-tree-zigzag-level-order-traversal](https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/) | [TypeScript](./src/binary-tree-zigzag-level-order-traversal/res.ts) | Medium | -| 104 | [Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree/) | [JavaScript](./src/maximum-depth-of-binary-tree/res.js) | Easy | -| 107 | [Binary Tree Level Order Traversal II](https://leetcode.com/problems/binary-tree-level-order-traversal-ii/) | [JavaScript](./src/binary-tree-level-order-traversal-ii/res.js) | Easy | -| 108 | [Convert Sorted Array to Binary Search Tree](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/) | [JavaScript](./src/convert-sorted-array-to-binary-search-tree/res.js) | Easy | -| 110 | [balanced-binary-tree](https://leetcode.com/problems/balanced-binary-tree/) | [TypeScript](./src/balanced-binary-tree/res.ts) | Easy | -| 111 | [Minimum Depth of Binary Tree](https://leetcode.com/problems/minimum-depth-of-binary-tree/) | [JavaScript](./src/minimum-depth-of-binary-tree/res.js) · [TypeScript](./src/minimum-depth-of-binary-tree/res.ts) | Easy | -| 114 | [flatten-binary-tree-to-linked-list](https://leetcode.com/problems/flatten-binary-tree-to-linked-list/) | [TypeScript](./src/flatten-binary-tree-to-linked-list/res.ts) | Medium | -| 116 | [populating-next-right-pointers-in-each-node](https://leetcode.com/problems/populating-next-right-pointers-in-each-node/) | [TypeScript](./src/populating-next-right-pointers-in-each-node/res.ts) | Medium | -| 120 | [Triangle](https://leetcode.com/problems/triangle/) | [JavaScript](./src/triangle/res.js) | Medium | -| 121 | [Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) | [JavaScript](./src/best-time-to-buy-and-sell-stock/res.js) | Easy | -| 122 | [Best Time to Buy and Sell Stock II](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-ii/res.js) | Easy | -| 123 | [Best Time to Buy and Sell Stock III](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/) * | [JavaScript](./src/best-time-to-buy-and-sell-stock-iii/res.js) | Hard | -| 127 | [Word Ladder](https://leetcode.com/problems/word-ladder/) | [JavaScript](./src/word-ladder/res.js) | Medium | -| 128 | [Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence/) | [JavaScript](./src/longest-consecutive-sequence/res.js) | Medium | -| 130 | [Surrounded Regions](https://leetcode.com/problems/surrounded-regions/) | [JavaScript](./src/surrounded-regions/res.js) | Medium | -| 131 | [palindrome-partitioning](https://leetcode.com/problems/palindrome-partitioning/) | [TypeScript](./src/palindrome-partitioning/res.ts) | Medium | -| 133 | [Clone Graph](https://leetcode.com/problems/clone-graph/) | [JavaScript](./src/clone-graph/res.js) | Medium | -| 134 | [Gas Station](https://leetcode.com/problems/gas-station/) | [JavaScript](./src/gas-station/res.js) · [TypeScript](./src/gas-station/res.ts) | Medium | -| 135 | [Candy](https://leetcode.com/problems/candy/) | [JavaScript](./src/candy/res.js) | Hard | -| 136 | [Single Number](https://leetcode.com/problems/single-number/) | [JavaScript](./src/single-number/res.js) | Easy | -| 137 | [Single Number II](https://leetcode.com/problems/single-number-ii/) | [JavaScript](./src/single-number-ii/res.js) | Medium | -| 139 | [word-break](https://leetcode.com/problems/word-break/) | [TypeScript](./src/word-break/res.ts) | Medium | -| 148 | [sort-list](https://leetcode.com/problems/sort-list/) | [TypeScript](./src/sort-list/res.ts) | Medium | -| 151 | [Reverse Words in a String](https://leetcode.com/problems/reverse-words-in-a-string/) | [JavaScript](./src/reverse-words-in-a-string/res.js) | Medium | -| 152 | [Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray/) | [JavaScript](./src/maximum-product-subarray/res.js) | Medium | -| 153 | [Find Minimum in Rotated Sorted Array](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/) | [JavaScript](./src/find-minimum-in-rotated-sorted-array/res.js) | Medium | -| 154 | [Find Minimum in Rotated Sorted Array II](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/) | [JavaScript](./src/find-minimum-in-rotated-sorted-array-ii/res.js) | Medium | -| 162 | [Find Peak Element](https://leetcode.com/problems/find-peak-element/) | [JavaScript](./src/find-peak-element/res.js) | Medium | -| 164 | [Maximum Gap](https://leetcode.com/problems/maximum-gap/) | [JavaScript](./src/maximum-gap/res.js) | Hard | -| 165 | [Compare Version Numbers](https://leetcode.com/problems/compare-version-numbers/) | [JavaScript](./src/compare-version-numbers/res.js) | Medium | -| 169 | [Majority Element](https://leetcode.com/problems/majority-element/) | [JavaScript](./src/majority-element/res.js) | Easy | -| 175 | [Combine Two Tables](https://leetcode.com/problems/combine-two-tables/) | [SQL](./src/combine-two-tables/res.txt) | Easy | -| 176 | [Second Highest Salary](https://leetcode.com/problems/second-highest-salary/) | [SQL](./src/second-highest-salary/res.txt) | Easy | -| 177 | [Nth Highest Salary](https://leetcode.com/problems/nth-highest-salary/) | [SQL](./src/nth-highest-salary/res.txt) | Medium | -| 179 | [largest-number](https://leetcode.com/problems/largest-number/) | [TypeScript](./src/largest-number/res.ts) | Medium | -| 181 | [Employees Earning More Than Their Managers](https://leetcode.com/problems/employees-earning-more-than-their-managers/) | [SQL](./src/employees-earning-more-than-their-managers/res.txt) | Easy | -| 182 | [Duplicate Emails](https://leetcode.com/problems/duplicate-emails/) | [SQL](./src/duplicate-emails/res.txt) | Easy | -| 183 | [Customers Who Never Order](https://leetcode.com/problems/customers-who-never-order/) | [SQL](./src/customers-who-never-order/res.txt) | Easy | -| 184 | [Department Highest Salary](https://leetcode.com/problems/department-highest-salary/) | [SQL](./src/department-highest-salary/res.txt) | Medium | -| 188 | [Best Time to Buy and Sell Stock IV](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-iv/res.txt) | Hard | -| 189 | [Rotate Array](https://leetcode.com/problems/rotate-array/) | [JavaScript](./src/rotate-array/res.js) | Easy | -| 190 | [Reverse Bits](https://leetcode.com/problems/reverse-bits/) | [JavaScript](./src/reverse-bits/res.js) | Easy | -| 196 | [Delete Duplicate Emails](https://leetcode.com/problems/delete-duplicate-emails/) | [SQL](./src/delete-duplicate-emails/res.txt) | Easy | -| 197 | [Rising Temperature](https://leetcode.com/problems/rising-temperature/) | [SQL](./src/rising-temperature/res.txt) | Easy | -| 206 | [Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/) | [JavaScript](./src/reverse-linked-list/res.js) | Easy | -| 207 | [Course Schedule](https://leetcode.com/problems/course-schedule/) | [JavaScript](./src/course-schedule/res.js) | Medium | -| 209 | [Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum/) | [JavaScript](./src/minimum-size-subarray-sum/res.js) | Medium | -| 210 | [Course Schedule II](https://leetcode.com/problems/course-schedule-ii/) | [JavaScript](./src/course-schedule-ii/res.js) | Medium | -| 215 | [Kth Largest Element in an Array](https://leetcode.com/problems/kth-largest-element-in-an-array/) | [JavaScript](./src/kth-largest-element-in-an-array/res.js) | Medium | -| 217 | [Contains Duplicate](https://leetcode.com/problems/contains-duplicate/) | [JavaScript](./src/contains-duplicate/res.js) | Easy | -| 219 | [Contains Duplicate II](https://leetcode.com/problems/contains-duplicate-ii/) | [JavaScript](./src/contains-duplicate-ii/res.js) | Easy | -| 220 | [Contains Duplicate III](https://leetcode.com/problems/contains-duplicate-iii/) | [JavaScript](./src/contains-duplicate-iii/res.js) | Medium | -| 228 | [Summary Ranges](https://leetcode.com/problems/summary-ranges/solution/) | [JavaScript](./src/summary-ranges/res.js) | Medium | -| 238 | [Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/solution/) | [JavaScript](./src/product-of-array-except-self/res.js) | Medium | -| 239 | [Sliding Window Maximum](https://leetcode.com/problems/sliding-window-maximum/description/) | [JavaScript](./src/sliding-window-maximum/description/res.js) | Hard | -| 240 | [Search a 2D Matrix II](https://leetcode.com/problems/search-a-2d-matrix-ii/) | [JavaScript](./src/search-a-2d-matrix-ii/res.js) · [TypeScript](./src/search-a-2d-matrix-ii/res.ts) | Medium | -| 274 | [H-Index](https://leetcode.com/problems/h-index/) | [JavaScript](./src/h-index/res.js) | Medium | -| 275 | [H-Index II](https://leetcode.com/problems/h-index-ii/) | [JavaScript](./src/h-index-ii/res.js) | Medium | -| 278 | [First Bad Version](https://leetcode.com/problems/first-bad-version/) | [JavaScript](./src/first-bad-version/res.js) | Easy | -| 283 | [Move Zeroes](https://leetcode.com/problems/move-zeroes/) | [JavaScript](./src/move-zeroes/res.js) | Easy | -| 287 | [Find the Duplicate Number](https://leetcode.com/problems/find-the-duplicate-number/) | [JavaScript](./src/find-the-duplicate-number/res.js) | Medium | -| 289 | [Game of Life](https://leetcode.com/problems/game-of-life/) | [JavaScript](./src/game-of-life/res.js) | Medium | -| 295 | [Find Median from Data Stream](https://leetcode.com/problems/find-median-from-data-stream/) | [JavaScript](./src/find-median-from-data-stream/res.js) | Hard | -| 299 | [Bulls and Cows](https://leetcode.com/problems/bulls-and-cows/) | [JavaScript](./src/bulls-and-cows/res.js) | Medium | -| 300 | [Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence/) | [JavaScript](./src/longest-increasing-subsequence/res.js) | Medium | -| 307 | [Range Sum Query - Mutable](https://leetcode.com/problems/range-sum-query-mutable/) | [JavaScript](./src/range-sum-query-mutable/res.js) | Medium | -| 309 | [Best Time to Buy and Sell Stock with Cooldown](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-with-cooldown/res.js) | Medium | -| 310 | [Minimum Height Trees](https://leetcode.com/problems/minimum-height-trees/) | [JavaScript](./src/minimum-height-trees/res.js) | Medium | -| 315 | [Count of Smaller Numbers After Self](https://leetcode.com/problems/count-of-smaller-numbers-after-self/) * | [JavaScript](./src/count-of-smaller-numbers-after-self/res.js) | Hard | -| 316 | [remove-duplicate-letters](https://leetcode.com/problems/remove-duplicate-letters/) | [TypeScript](./src/remove-duplicate-letters/res.ts) | Medium | -| 322 | [Coin Change](https://leetcode.com/problems/coin-change/) | [JavaScript](./src/coin-change/res.js) | Medium | -| 327 | [Count of Range Sum](https://leetcode.com/problems/count-of-range-sum/) | [JavaScript](./src/count-of-range-sum/res.js) | Hard | -| 334 | [Increasing Triplet Subsequence](https://leetcode.com/problems/increasing-triplet-subsequence/) | [JavaScript](./src/increasing-triplet-subsequence/res.js) | Medium | -| 340 | [Longest Substring with At Most K Distinct Characters](https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters/) | [JavaScript](./src/longest-substring-with-at-most-k-distinct-characters/res.js) | Hard | -| 342 | [Power of Four](https://leetcode.com/problems/power-of-four/) | [JavaScript](./src/power-of-four/res.js) | Easy | -| 344 | [Reverse String](https://leetcode.com/problems/reverse-string/) | [JavaScript](./src/reverse-string/res.js) | Easy | -| 349 | [Intersection of Two Arrays](https://leetcode.com/problems/intersection-of-two-arrays/) | [JavaScript](./src/intersection-of-two-arrays/res.js) | Easy | -| 350 | [Intersection of Two Arrays ii](https://leetcode.com/problems/intersection-of-two-arrays-ii/) | [JavaScript](./src/intersection-of-two-arrays-ii/res.js) | Easy | -| 371 | [Sum of Two Integers](https://leetcode.com/problems/sum-of-two-integers/) | [JavaScript](./src/sum-of-two-integers/res.js) | Easy | -| 374 | [Guess Number Higher or Lower](https://leetcode.com/problems/guess-number-higher-or-lower/) | [JavaScript](./src/guess-number-higher-or-lower/res.py) | Easy | -| 376 | [Wiggle Subsequence](https://leetcode.com/problems/wiggle-subsequence/) | [JavaScript](./src/wiggle-subsequence/res.js) | Medium | -| 384 | [Shuffle an Array](https://leetcode.com/problems/shuffle-an-array/) | [JavaScript](./src/shuffle-an-array/res.js) | Medium | -| 395 | [Longest Substring with At Least K Repeating Characters](https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters/) | [JavaScript](./src/longest-substring-with-at-least-k-repeating-characters/res.js) | Medium | -| 404 | [Sum of Left Leaves](https://leetcode.com/problems/sum-of-left-leaves/) | [JavaScript](./src/sum-of-left-leaves/res.js) | Easy | -| 413 | [Arithmetic Slices](https://leetcode.com/problems/arithmetic-slices/) | [JavaScript](./src/arithmetic-slices/res.js) | Medium | -| 416 | [Partition Equal Subset Sum](https://leetcode.com/problems/partition-equal-subset-sum/) | [JavaScript](./src/partition-equal-subset-sum/res.js) | Medium | -| 424 | [Longest Repeating Character Replacement](https://leetcode.com/problems/longest-repeating-character-replacement/) | [JavaScript](./src/longest-repeating-character-replacement/res.js) | Medium | -| 434 | [Number of Segments in a String](https://leetcode.com/problems/number-of-segments-in-a-string/) | [JavaScript](./src/number-of-segments-in-a-string/res.js) | Easy | -| 486 | [Predict the Winner](https://leetcode.com/problems/predict-the-winner/) | [JavaScript](./src/predict-the-winner/res.js) | Medium | -| 494 | [Target Sum](https://leetcode.com/problems/target-sum/) | [JavaScript](./src/target-sum/res.js) | Medium | -| 516 | [Longest Palindromic Subsequence](https://leetcode.com/problems/longest-palindromic-subsequence/) | [JavaScript](./src/longest-palindromic-subsequence/res.js) | Medium | -| 523 | [Continuous Subarray Sum](https://leetcode.com/problems/continuous-subarray-sum/) | [JavaScript](./src/continuous-subarray-sum/res.js) | Medium | -| 539 | [Minimum Time Difference](https://leetcode.com/problems/minimum-time-difference/) | [JavaScript](./src/minimum-time-difference/res.js) | Medium | -| 687 | [Longest Univalue Path](https://leetcode.com/problems/longest-univalue-path/) | [JavaScript](./src/longest-univalue-path/res.js) | Easy | -| 779 | [K-th Symbol in Grammar](https://leetcode.com/problems/k-th-symbol-in-grammar/) | [JavaScript](./src/k-th-symbol-in-grammar/res.js) | Medium | -| NO | [NAME](https://leetcode.com/problems/XXX/) | [TypeScript](./src/XXX/res.ts) | Easy | +| ID | Title | Solution | Difficulty | +|-----|-------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|------------| +| 1 | [Two Sum](https://leetcode.com/problems/two-sum/) | [JavaScript](./src/two-sum/res.js) | Easy | +| 2 | [Add Two Numbers](https://leetcode.com/problems/add-two-numbers/) | [JavaScript](./src/add-two-numbers/res.js) | Medium | +| 3 | [Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | [JavaScript](./src/longest-substring-without-repeating-characters/res.js) | Medium | +| 4 | [Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/) | [JavaScript](./src/median-of-two-sorted-arrays/res.js) | Hard | +| 5 | [Longest Palindromic Substring](https://leetcode.com/problems/longest-palindromic-substring/) | [JavaScript](./src/longest-palindromic-substring/res.js) | Medium | +| 6 | [ZigZag Conversion](https://leetcode.com/problems/zigzag-conversion/) | [JavaScript](./src/zigzag-conversion/res.js) | Medium | +| 7 | [Reverse Integer](https://leetcode.com/problems/reverse-integer/) | [JavaScript](./src/reverse-integer/res.js) | Easy | +| 8 | [String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi/) | [JavaScript](./src/string-to-integer-atoi/res.js) | Medium | +| 11 | [Container With Most Water](https://leetcode.com/problems/container-with-most-water/) | [JavaScript](./src/container-with-most-water/res.js) | Medium | +| 13 | [Roman to Integer](https://leetcode.com/problems/roman-to-integer/) | [JavaScript](./src/roman-to-integer/res.js) | Easy | +| 14 | [Longest Common Prefix](https://leetcode.com/problems/longest-common-prefix/) | [JavaScript](./src/longest-common-prefix/res.js) | Easy | +| 15 | [3Sum](https://leetcode.com/problems/3sum/) | [JavaScript](./src/3sum/res.js) | Medium | +| 16 | [3Sum Closest](https://leetcode.com/problems/3sum-closest/) | [JavaScript](./src/3sum-closest/res.js) | Medium | +| 17 | [Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/) | [JavaScript](./src/letter-combinations-of-a-phone-number/res.js) | Medium | +| 19 | [Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) | [JavaScript](./src/remove-nth-node-from-end-of-list/res.js) | Medium | +| 22 | [Generate Parentheses](https://leetcode.com/problems/generate-parentheses/) | [JavaScript](./src/generate-parentheses/res.js) | Medium | +| 26 | [Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/) | [JavaScript](./src/remove-duplicates-from-sorted-array/res.js) | Easy | +| 27 | [Remove Element](https://leetcode.com/problems/remove-element/) | [JavaScript](./src/remove-element/res.js) | Easy | +| 28 | [Implement strStr()](https://leetcode.com/problems/implement-strstr/) | [JavaScript](./src/implement-strstr/res.js) | Easy | +| 29 | [Divide Two Integers](https://leetcode.com/problems/divide-two-integers/) | [JavaScript](./src/divide-two-integers/res.js) | Medium | +| 33 | [Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/) | [JavaScript](./src/search-in-rotated-sorted-array/res.js) | Medium | +| 34 | [Search for a Range](https://leetcode.com/problems/search-for-a-range/) | [JavaScript](./src/search-for-a-range/res.js) | Medium | +| 35 | [Search Insert Position](https://leetcode.com/problems/search-insert-position/) | [JavaScript](./src/search-insert-position/res.js) | Easy | +| 39 | [Combination Sum](https://leetcode.com/problems/combination-sum/) | [JavaScript](./src/combination-sum/res.js) | Medium | +| 40 | [Combination Sum II](https://leetcode.com/problems/combination-sum-ii/) | [JavaScript](./src/combination-sum-ii/res.js) | Medium | +| 41 | [First Missing Positive](https://leetcode.com/problems/first-missing-positive/description/) | [JavaScript](./src/first-missing-positive/res.js) | Hard | +| 42 | [ Trapping Rain Water](https://leetcode.com/problems/trapping-rain-water/description/) | [JavaScript](./src/trapping-rain-water/res.js) | Hard | +| 43 | [Multiply Strings](https://leetcode.com/problems/multiply-strings/) | [JavaScript](./src/multiply-strings/res.js) | Medium | +| 45 | [Jump Game II](https://leetcode.com/problems/jump-game-ii/) | [JavaScript](./src/jump-game-ii/res.js) | Hard | +| 46 | [Permutations](https://leetcode.com/problems/permutations/) | [JavaScript](./src/permutations/res.js) | Medium | +| 48 | [Rotate Image](https://leetcode.com/problems/rotate-image/) | [JavaScript](./src/rotate-image/res.js) | Medium | +| 49 | [Group Anagrams](https://leetcode.com/problems/anagrams/) | [JavaScript](./src/anagrams/res.js) | Medium | +| 53 | [Maximum Subarray](https://leetcode.com/problems/maximum-subarray/) | [JavaScript](./src/maximum-subarray/res.js) · [TypeScript](./src/maximum-subarray/res.ts) | Easy | +| 54 | [Spiral Matrix](https://leetcode.com/problems/spiral-matrix/) | [JavaScript](./src/spiral-matrix/res.js) | Medium | +| 55 | [Jump Game](https://leetcode.com/problems/jump-game/) * | [JavaScript](./src/jump-game/res.js) | Medium | +| 56 | [Merge Intervals](https://leetcode.com/problems/merge-intervals/) | [JavaScript](./src/merge-intervals/res.js) | Medium | +| 57 | [Insert Interval](https://leetcode.com/problems/insert-interval/) | [JavaScript](./src/insert-interval/res.js) | Hard | +| 62 | [Unique Paths](https://leetcode.com/problems/unique-paths/) | [JavaScript](./src/unique-paths/res.js) | Medium | +| 63 | [Unique Paths ii](https://leetcode.com/problems/unique-paths-ii/) | [JavaScript](./src/unique-paths-ii/res.js) | Medium | +| 64 | [minimum-path-sum](https://leetcode.com/problems/minimum-path-sum/) | [TypeScript](./src/minimum-path-sum/res.ts) | Medium | +| 66 | [Plus One](https://leetcode.com/problems/plus-one/) | [JavaScript](./src/plus-one/res.js) | Easy | +| 69 | [Sqrt(x)](https://leetcode.com/problems/sqrtx/) | [JavaScript](./src/sqrtx/res.js) | Easy | +| 70 | [climbing-stairs](https://leetcode.com/problems/climbing-stairs/) | [TypeScript](./src/climbing-stairs/res.ts) | Easy | +| 71 | [Simplify Path](https://leetcode.com/problems/simplify-path/) | [JavaScript](./src/simplify-path/res.js) | Medium | +| 73 | [Set Matrix Zeroes](https://leetcode.com/problems/set-matrix-zeroes/) | [JavaScript](./src/set-matrix-zeroes/res.js) | Medium | +| 75 | [Sort Colors](https://leetcode.com/problems/sort-colors/) | [JavaScript](./src/sort-colors/res.js) | Medium | +| 80 | [Remove Duplicates from Sorted Array II](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/) | [JavaScript](./src/remove-duplicates-from-sorted-array-ii/res.js) | Medium | +| 81 | [Search in Rotated Sorted Array II](https://leetcode.com/problems/search-in-rotated-sorted-array-ii/) | [JavaScript](./src/search-in-rotated-sorted-array-ii/res.js) | Medium | +| 88 | [ Merge Sorted Array](https://leetcode.com/problems/merge-sorted-array/) | [JavaScript](./src/merge-sorted-array/res.js) | Medium | +| 91 | [Decode Ways](https://leetcode.com/problems/decode-ways/) | [JavaScript](./src/decode-ways/res.js) | Medium | +| 93 | [Restore IP Addresses](https://leetcode.com/problems/restore-ip-addresses/) | [JavaScript](./src/restore-ip-addresses/res.js) | Medium | +| 94 | [Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal/) | [TypeScript](./src/binary-tree-inorder-traversal/res.ts) | Easy | +| 96 | [unique-binary-search-trees](https://leetcode.com/problems/unique-binary-search-trees/) | [TypeScript](./src/unique-binary-search-trees/res.ts) | Medium | +| 97 | [interleaving-string](https://leetcode.com/problems/interleaving-string/) | [TypeScript](./src/interleaving-string/res.ts) | Medium | +| 98 | [Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/) | [JavaScript](./src/validate-binary-search-tree/res.js) | Medium | +| 100 | [Same Tree](https://leetcode.com/problems/same-tree/) | [JavaScript](./src/same-tree/res.js) | Easy | +| 101 | [Symmetric Tree](https://leetcode.com/problems/symmetric-tree/) | [JavaScript](./src/symmetric-tree/res.js) | Easy | +| 102 | [Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/) | [JavaScript](./src/binary-tree-level-order-traversal/res.js) | Medium | +| 103 | [binary-tree-zigzag-level-order-traversal](https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/) | [TypeScript](./src/binary-tree-zigzag-level-order-traversal/res.ts) | Medium | +| 104 | [Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree/) | [JavaScript](./src/maximum-depth-of-binary-tree/res.js) | Easy | +| 107 | [Binary Tree Level Order Traversal II](https://leetcode.com/problems/binary-tree-level-order-traversal-ii/) | [JavaScript](./src/binary-tree-level-order-traversal-ii/res.js) | Easy | +| 108 | [Convert Sorted Array to Binary Search Tree](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/) | [JavaScript](./src/convert-sorted-array-to-binary-search-tree/res.js) | Easy | +| 110 | [balanced-binary-tree](https://leetcode.com/problems/balanced-binary-tree/) | [TypeScript](./src/balanced-binary-tree/res.ts) | Easy | +| 111 | [Minimum Depth of Binary Tree](https://leetcode.com/problems/minimum-depth-of-binary-tree/) | [JavaScript](./src/minimum-depth-of-binary-tree/res.js) · [TypeScript](./src/minimum-depth-of-binary-tree/res.ts) | Easy | +| 114 | [flatten-binary-tree-to-linked-list](https://leetcode.com/problems/flatten-binary-tree-to-linked-list/) | [TypeScript](./src/flatten-binary-tree-to-linked-list/res.ts) | Medium | +| 116 | [populating-next-right-pointers-in-each-node](https://leetcode.com/problems/populating-next-right-pointers-in-each-node/) | [TypeScript](./src/populating-next-right-pointers-in-each-node/res.ts) | Medium | +| 120 | [Triangle](https://leetcode.com/problems/triangle/) | [JavaScript](./src/triangle/res.js) | Medium | +| 121 | [Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) | [JavaScript](./src/best-time-to-buy-and-sell-stock/res.js) | Easy | +| 122 | [Best Time to Buy and Sell Stock II](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-ii/res.js) | Easy | +| 123 | [Best Time to Buy and Sell Stock III](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/) * | [JavaScript](./src/best-time-to-buy-and-sell-stock-iii/res.js) | Hard | +| 127 | [Word Ladder](https://leetcode.com/problems/word-ladder/) | [JavaScript](./src/word-ladder/res.js) | Medium | +| 128 | [Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence/) | [JavaScript](./src/longest-consecutive-sequence/res.js) | Medium | +| 130 | [Surrounded Regions](https://leetcode.com/problems/surrounded-regions/) | [JavaScript](./src/surrounded-regions/res.js) | Medium | +| 131 | [palindrome-partitioning](https://leetcode.com/problems/palindrome-partitioning/) | [TypeScript](./src/palindrome-partitioning/res.ts) | Medium | +| 133 | [Clone Graph](https://leetcode.com/problems/clone-graph/) | [JavaScript](./src/clone-graph/res.js) | Medium | +| 134 | [Gas Station](https://leetcode.com/problems/gas-station/) | [JavaScript](./src/gas-station/res.js) · [TypeScript](./src/gas-station/res.ts) | Medium | +| 135 | [Candy](https://leetcode.com/problems/candy/) | [JavaScript](./src/candy/res.js) | Hard | +| 136 | [Single Number](https://leetcode.com/problems/single-number/) | [JavaScript](./src/single-number/res.js) | Easy | +| 137 | [Single Number II](https://leetcode.com/problems/single-number-ii/) | [JavaScript](./src/single-number-ii/res.js) | Medium | +| 139 | [word-break](https://leetcode.com/problems/word-break/) | [TypeScript](./src/word-break/res.ts) | Medium | +| 148 | [sort-list](https://leetcode.com/problems/sort-list/) | [TypeScript](./src/sort-list/res.ts) | Medium | +| 151 | [Reverse Words in a String](https://leetcode.com/problems/reverse-words-in-a-string/) | [JavaScript](./src/reverse-words-in-a-string/res.js) | Medium | +| 152 | [Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray/) | [JavaScript](./src/maximum-product-subarray/res.js) | Medium | +| 153 | [Find Minimum in Rotated Sorted Array](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/) | [JavaScript](./src/find-minimum-in-rotated-sorted-array/res.js) | Medium | +| 154 | [Find Minimum in Rotated Sorted Array II](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/) | [JavaScript](./src/find-minimum-in-rotated-sorted-array-ii/res.js) | Medium | +| 162 | [Find Peak Element](https://leetcode.com/problems/find-peak-element/) | [JavaScript](./src/find-peak-element/res.js) | Medium | +| 164 | [Maximum Gap](https://leetcode.com/problems/maximum-gap/) | [JavaScript](./src/maximum-gap/res.js) | Hard | +| 165 | [Compare Version Numbers](https://leetcode.com/problems/compare-version-numbers/) | [JavaScript](./src/compare-version-numbers/res.js) | Medium | +| 169 | [Majority Element](https://leetcode.com/problems/majority-element/) | [JavaScript](./src/majority-element/res.js) | Easy | +| 175 | [Combine Two Tables](https://leetcode.com/problems/combine-two-tables/) | [SQL](./src/combine-two-tables/res.txt) | Easy | +| 176 | [Second Highest Salary](https://leetcode.com/problems/second-highest-salary/) | [SQL](./src/second-highest-salary/res.txt) | Easy | +| 177 | [Nth Highest Salary](https://leetcode.com/problems/nth-highest-salary/) | [SQL](./src/nth-highest-salary/res.txt) | Medium | +| 179 | [largest-number](https://leetcode.com/problems/largest-number/) | [TypeScript](./src/largest-number/res.ts) | Medium | +| 181 | [Employees Earning More Than Their Managers](https://leetcode.com/problems/employees-earning-more-than-their-managers/) | [SQL](./src/employees-earning-more-than-their-managers/res.txt) | Easy | +| 182 | [Duplicate Emails](https://leetcode.com/problems/duplicate-emails/) | [SQL](./src/duplicate-emails/res.txt) | Easy | +| 183 | [Customers Who Never Order](https://leetcode.com/problems/customers-who-never-order/) | [SQL](./src/customers-who-never-order/res.txt) | Easy | +| 184 | [Department Highest Salary](https://leetcode.com/problems/department-highest-salary/) | [SQL](./src/department-highest-salary/res.txt) | Medium | +| 188 | [Best Time to Buy and Sell Stock IV](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-iv/res.txt) | Hard | +| 189 | [Rotate Array](https://leetcode.com/problems/rotate-array/) | [JavaScript](./src/rotate-array/res.js) | Easy | +| 190 | [Reverse Bits](https://leetcode.com/problems/reverse-bits/) | [JavaScript](./src/reverse-bits/res.js) | Easy | +| 196 | [Delete Duplicate Emails](https://leetcode.com/problems/delete-duplicate-emails/) | [SQL](./src/delete-duplicate-emails/res.txt) | Easy | +| 197 | [Rising Temperature](https://leetcode.com/problems/rising-temperature/) | [SQL](./src/rising-temperature/res.txt) | Easy | +| 206 | [Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/) | [JavaScript](./src/reverse-linked-list/res.js) | Easy | +| 207 | [Course Schedule](https://leetcode.com/problems/course-schedule/) | [JavaScript](./src/course-schedule/res.js) | Medium | +| 209 | [Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum/) | [JavaScript](./src/minimum-size-subarray-sum/res.js) | Medium | +| 210 | [Course Schedule II](https://leetcode.com/problems/course-schedule-ii/) | [JavaScript](./src/course-schedule-ii/res.js) | Medium | +| 215 | [Kth Largest Element in an Array](https://leetcode.com/problems/kth-largest-element-in-an-array/) | [JavaScript](./src/kth-largest-element-in-an-array/res.js) | Medium | +| 217 | [Contains Duplicate](https://leetcode.com/problems/contains-duplicate/) | [JavaScript](./src/contains-duplicate/res.js) | Easy | +| 219 | [Contains Duplicate II](https://leetcode.com/problems/contains-duplicate-ii/) | [JavaScript](./src/contains-duplicate-ii/res.js) | Easy | +| 220 | [Contains Duplicate III](https://leetcode.com/problems/contains-duplicate-iii/) | [JavaScript](./src/contains-duplicate-iii/res.js) | Medium | +| 228 | [Summary Ranges](https://leetcode.com/problems/summary-ranges/solution/) | [JavaScript](./src/summary-ranges/res.js) | Medium | +| 238 | [Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/solution/) | [JavaScript](./src/product-of-array-except-self/res.js) | Medium | +| 239 | [Sliding Window Maximum](https://leetcode.com/problems/sliding-window-maximum/description/) | [JavaScript](./src/sliding-window-maximum/description/res.js) | Hard | +| 240 | [Search a 2D Matrix II](https://leetcode.com/problems/search-a-2d-matrix-ii/) | [JavaScript](./src/search-a-2d-matrix-ii/res.js) · [TypeScript](./src/search-a-2d-matrix-ii/res.ts) | Medium | +| 274 | [H-Index](https://leetcode.com/problems/h-index/) | [JavaScript](./src/h-index/res.js) | Medium | +| 275 | [H-Index II](https://leetcode.com/problems/h-index-ii/) | [JavaScript](./src/h-index-ii/res.js) | Medium | +| 278 | [First Bad Version](https://leetcode.com/problems/first-bad-version/) | [JavaScript](./src/first-bad-version/res.js) | Easy | +| 283 | [Move Zeroes](https://leetcode.com/problems/move-zeroes/) | [JavaScript](./src/move-zeroes/res.js) | Easy | +| 287 | [Find the Duplicate Number](https://leetcode.com/problems/find-the-duplicate-number/) | [JavaScript](./src/find-the-duplicate-number/res.js) | Medium | +| 289 | [Game of Life](https://leetcode.com/problems/game-of-life/) | [JavaScript](./src/game-of-life/res.js) | Medium | +| 295 | [Find Median from Data Stream](https://leetcode.com/problems/find-median-from-data-stream/) | [JavaScript](./src/find-median-from-data-stream/res.js) | Hard | +| 299 | [Bulls and Cows](https://leetcode.com/problems/bulls-and-cows/) | [JavaScript](./src/bulls-and-cows/res.js) | Medium | +| 300 | [Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence/) | [JavaScript](./src/longest-increasing-subsequence/res.js) | Medium | +| 307 | [Range Sum Query - Mutable](https://leetcode.com/problems/range-sum-query-mutable/) | [JavaScript](./src/range-sum-query-mutable/res.js) | Medium | +| 309 | [Best Time to Buy and Sell Stock with Cooldown](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-with-cooldown/res.js) | Medium | +| 310 | [Minimum Height Trees](https://leetcode.com/problems/minimum-height-trees/) | [JavaScript](./src/minimum-height-trees/res.js) | Medium | +| 315 | [Count of Smaller Numbers After Self](https://leetcode.com/problems/count-of-smaller-numbers-after-self/) * | [JavaScript](./src/count-of-smaller-numbers-after-self/res.js) | Hard | +| 316 | [remove-duplicate-letters](https://leetcode.com/problems/remove-duplicate-letters/) | [TypeScript](./src/remove-duplicate-letters/res.ts) | Medium | +| 322 | [Coin Change](https://leetcode.com/problems/coin-change/) | [JavaScript](./src/coin-change/res.js) | Medium | +| 327 | [Count of Range Sum](https://leetcode.com/problems/count-of-range-sum/) | [JavaScript](./src/count-of-range-sum/res.js) | Hard | +| 334 | [Increasing Triplet Subsequence](https://leetcode.com/problems/increasing-triplet-subsequence/) | [JavaScript](./src/increasing-triplet-subsequence/res.js) · [TypeScript](./src/increasing-triplet-subsequence/res.ts) | Medium | +| 340 | [Longest Substring with At Most K Distinct Characters](https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters/) | [JavaScript](./src/longest-substring-with-at-most-k-distinct-characters/res.js) | Hard | +| 342 | [Power of Four](https://leetcode.com/problems/power-of-four/) | [JavaScript](./src/power-of-four/res.js) | Easy | +| 344 | [Reverse String](https://leetcode.com/problems/reverse-string/) | [JavaScript](./src/reverse-string/res.js) | Easy | +| 349 | [Intersection of Two Arrays](https://leetcode.com/problems/intersection-of-two-arrays/) | [JavaScript](./src/intersection-of-two-arrays/res.js) | Easy | +| 350 | [Intersection of Two Arrays ii](https://leetcode.com/problems/intersection-of-two-arrays-ii/) | [JavaScript](./src/intersection-of-two-arrays-ii/res.js) | Easy | +| 371 | [Sum of Two Integers](https://leetcode.com/problems/sum-of-two-integers/) | [JavaScript](./src/sum-of-two-integers/res.js) | Easy | +| 374 | [Guess Number Higher or Lower](https://leetcode.com/problems/guess-number-higher-or-lower/) | [JavaScript](./src/guess-number-higher-or-lower/res.py) | Easy | +| 376 | [Wiggle Subsequence](https://leetcode.com/problems/wiggle-subsequence/) | [JavaScript](./src/wiggle-subsequence/res.js) | Medium | +| 384 | [Shuffle an Array](https://leetcode.com/problems/shuffle-an-array/) | [JavaScript](./src/shuffle-an-array/res.js) | Medium | +| 395 | [Longest Substring with At Least K Repeating Characters](https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters/) | [JavaScript](./src/longest-substring-with-at-least-k-repeating-characters/res.js) | Medium | +| 404 | [Sum of Left Leaves](https://leetcode.com/problems/sum-of-left-leaves/) | [JavaScript](./src/sum-of-left-leaves/res.js) | Easy | +| 413 | [Arithmetic Slices](https://leetcode.com/problems/arithmetic-slices/) | [JavaScript](./src/arithmetic-slices/res.js) | Medium | +| 416 | [Partition Equal Subset Sum](https://leetcode.com/problems/partition-equal-subset-sum/) | [JavaScript](./src/partition-equal-subset-sum/res.js) | Medium | +| 424 | [Longest Repeating Character Replacement](https://leetcode.com/problems/longest-repeating-character-replacement/) | [JavaScript](./src/longest-repeating-character-replacement/res.js) | Medium | +| 434 | [Number of Segments in a String](https://leetcode.com/problems/number-of-segments-in-a-string/) | [JavaScript](./src/number-of-segments-in-a-string/res.js) | Easy | +| 486 | [Predict the Winner](https://leetcode.com/problems/predict-the-winner/) | [JavaScript](./src/predict-the-winner/res.js) | Medium | +| 494 | [Target Sum](https://leetcode.com/problems/target-sum/) | [JavaScript](./src/target-sum/res.js) | Medium | +| 516 | [Longest Palindromic Subsequence](https://leetcode.com/problems/longest-palindromic-subsequence/) | [JavaScript](./src/longest-palindromic-subsequence/res.js) | Medium | +| 523 | [Continuous Subarray Sum](https://leetcode.com/problems/continuous-subarray-sum/) | [JavaScript](./src/continuous-subarray-sum/res.js) | Medium | +| 539 | [Minimum Time Difference](https://leetcode.com/problems/minimum-time-difference/) | [JavaScript](./src/minimum-time-difference/res.js) | Medium | +| 687 | [Longest Univalue Path](https://leetcode.com/problems/longest-univalue-path/) | [JavaScript](./src/longest-univalue-path/res.js) | Easy | +| 779 | [K-th Symbol in Grammar](https://leetcode.com/problems/k-th-symbol-in-grammar/) | [JavaScript](./src/k-th-symbol-in-grammar/res.js) | Medium | +| NO | [NAME](https://leetcode.com/problems/XXX/) | [TypeScript](./src/XXX/res.ts) | Easy | diff --git a/src/increasing-triplet-subsequence/res.ts b/src/increasing-triplet-subsequence/res.ts index e69de29..01b964b 100644 --- a/src/increasing-triplet-subsequence/res.ts +++ b/src/increasing-triplet-subsequence/res.ts @@ -0,0 +1,28 @@ +function increasingTriplet(nums: number[]): boolean { + if (nums.length < 3) { + return false; + } + + let currentLMinNum = Number.MAX_SAFE_INTEGER; + const lMin = nums.map((num) => { + currentLMinNum = num < currentLMinNum ? num : currentLMinNum; + + return currentLMinNum; + }); + let currentMaxNum = Number.MIN_SAFE_INTEGER; + const rMax = new Array(nums.length); + for (let i = nums.length-1; i >= 0; i--) { + currentMaxNum = nums[i] > currentMaxNum ? nums[i] : currentMaxNum; + rMax[i] = currentMaxNum; + } + + let result = false; + for (let i = 1; i < nums.length-1; i++) { + if (lMin[i-1] < nums[i] && nums[i] < rMax[i+1]) { + result = true; + break; + } + } + + return result; +}; \ No newline at end of file From 72885e31487d69ca6607977fa1151517db32a93e Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Mon, 27 Jun 2022 19:51:30 +0800 Subject: [PATCH 24/53] update: 376 --- README.md | 2 +- src/wiggle-subsequence/res.ts | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 src/wiggle-subsequence/res.ts diff --git a/README.md b/README.md index 336888a..9cd305a 100644 --- a/README.md +++ b/README.md @@ -146,7 +146,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 350 | [Intersection of Two Arrays ii](https://leetcode.com/problems/intersection-of-two-arrays-ii/) | [JavaScript](./src/intersection-of-two-arrays-ii/res.js) | Easy | | 371 | [Sum of Two Integers](https://leetcode.com/problems/sum-of-two-integers/) | [JavaScript](./src/sum-of-two-integers/res.js) | Easy | | 374 | [Guess Number Higher or Lower](https://leetcode.com/problems/guess-number-higher-or-lower/) | [JavaScript](./src/guess-number-higher-or-lower/res.py) | Easy | -| 376 | [Wiggle Subsequence](https://leetcode.com/problems/wiggle-subsequence/) | [JavaScript](./src/wiggle-subsequence/res.js) | Medium | +| 376 | [Wiggle Subsequence](https://leetcode.com/problems/wiggle-subsequence/) | [JavaScript](./src/wiggle-subsequence/res.js) · [TypeScript](./src/wiggle-subsequence/res.ts) | Medium | | 384 | [Shuffle an Array](https://leetcode.com/problems/shuffle-an-array/) | [JavaScript](./src/shuffle-an-array/res.js) | Medium | | 395 | [Longest Substring with At Least K Repeating Characters](https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters/) | [JavaScript](./src/longest-substring-with-at-least-k-repeating-characters/res.js) | Medium | | 404 | [Sum of Left Leaves](https://leetcode.com/problems/sum-of-left-leaves/) | [JavaScript](./src/sum-of-left-leaves/res.js) | Easy | diff --git a/src/wiggle-subsequence/res.ts b/src/wiggle-subsequence/res.ts new file mode 100644 index 0000000..57fd9bb --- /dev/null +++ b/src/wiggle-subsequence/res.ts @@ -0,0 +1,13 @@ +function wiggleMaxLength(nums: number[]): number { + let up = 1, down = 1; + + for (let i = 1; i < nums.length; i++) { + if (nums[i] > nums[i-1]) { + up = down + 1; + } else if (nums[i] < nums[i-1]) { + down = up + 1; + } + } + + return Math.max(up, down); +}; \ No newline at end of file From 6dd1267edad1c2c4142daacc48888aca0a93f813 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Mon, 27 Jun 2022 20:03:57 +0800 Subject: [PATCH 25/53] update: 376-2 --- src/wiggle-subsequence/res.ts | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/wiggle-subsequence/res.ts b/src/wiggle-subsequence/res.ts index 57fd9bb..944bca5 100644 --- a/src/wiggle-subsequence/res.ts +++ b/src/wiggle-subsequence/res.ts @@ -10,4 +10,25 @@ function wiggleMaxLength(nums: number[]): number { } return Math.max(up, down); -}; \ No newline at end of file +}; + +function wiggleMaxLength2(nums: number[]): number { + if (nums.length < 2) { + return nums.length; + } + + let currentDiff = 0; + let previousDiff = 0; + let result = 0; + + for (let i = 1; i < nums.length; i++) { + currentDiff = nums[i] - nums[i-1]; + + if (currentDiff>0 && previousDiff<=0 || currentDiff<0 && previousDiff>=0) { + previousDiff = currentDiff; + result++; + } + } + + return result+1; +} \ No newline at end of file From fa07a985c13c4cbb6b91a06f6d81508bfd73c131 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Mon, 27 Jun 2022 20:53:27 +0800 Subject: [PATCH 26/53] update: 406 --- README.md | 1 + src/queue-reconstruction-by-height/res.ts | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 src/queue-reconstruction-by-height/res.ts diff --git a/README.md b/README.md index 9cd305a..90fe81c 100644 --- a/README.md +++ b/README.md @@ -150,6 +150,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 384 | [Shuffle an Array](https://leetcode.com/problems/shuffle-an-array/) | [JavaScript](./src/shuffle-an-array/res.js) | Medium | | 395 | [Longest Substring with At Least K Repeating Characters](https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters/) | [JavaScript](./src/longest-substring-with-at-least-k-repeating-characters/res.js) | Medium | | 404 | [Sum of Left Leaves](https://leetcode.com/problems/sum-of-left-leaves/) | [JavaScript](./src/sum-of-left-leaves/res.js) | Easy | +| 406 | [queue-reconstruction-by-height](https://leetcode.com/problems/queue-reconstruction-by-height/) | [TypeScript](./src/queue-reconstruction-by-height/res.ts) | Medium | | 413 | [Arithmetic Slices](https://leetcode.com/problems/arithmetic-slices/) | [JavaScript](./src/arithmetic-slices/res.js) | Medium | | 416 | [Partition Equal Subset Sum](https://leetcode.com/problems/partition-equal-subset-sum/) | [JavaScript](./src/partition-equal-subset-sum/res.js) | Medium | | 424 | [Longest Repeating Character Replacement](https://leetcode.com/problems/longest-repeating-character-replacement/) | [JavaScript](./src/longest-repeating-character-replacement/res.js) | Medium | diff --git a/src/queue-reconstruction-by-height/res.ts b/src/queue-reconstruction-by-height/res.ts new file mode 100644 index 0000000..63dd1a0 --- /dev/null +++ b/src/queue-reconstruction-by-height/res.ts @@ -0,0 +1,19 @@ +/** + * 先按照高度降序排列,再按照人数升序排列 + * 然后依次插入,每次插入时,之前插入过的元素都会比当前元素要高 + * @param people + */ +function reconstructQueue(people: number[][]): number[][] { + people.sort((a, b) => (b[0] - a[0]) || (a[1] - b[1])); + + let result: number[][] = []; + people.forEach(item => { + if (item[1] >= result.length) { + result.push(item); + } else { + result = [...result.slice(0, item[1]), item, ...result.slice(item[1])]; + } + }); + + return result; +}; \ No newline at end of file From 075a57ff47765bd250fc0172342cbbe51cd4d7a6 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Tue, 28 Jun 2022 11:32:33 +0800 Subject: [PATCH 27/53] update: 24 --- README.md | 1 + src/swap-nodes-in-pairs/res.ts | 40 ++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/swap-nodes-in-pairs/res.ts diff --git a/README.md b/README.md index 90fe81c..dd0ffb6 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 17 | [Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/) | [JavaScript](./src/letter-combinations-of-a-phone-number/res.js) | Medium | | 19 | [Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) | [JavaScript](./src/remove-nth-node-from-end-of-list/res.js) | Medium | | 22 | [Generate Parentheses](https://leetcode.com/problems/generate-parentheses/) | [JavaScript](./src/generate-parentheses/res.js) | Medium | +| 24 | [swap-nodes-in-pairs](https://leetcode.com/problems/swap-nodes-in-pairs/) | [TypeScript](./src/swap-nodes-in-pairs/res.ts) | Medium | | 26 | [Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/) | [JavaScript](./src/remove-duplicates-from-sorted-array/res.js) | Easy | | 27 | [Remove Element](https://leetcode.com/problems/remove-element/) | [JavaScript](./src/remove-element/res.js) | Easy | | 28 | [Implement strStr()](https://leetcode.com/problems/implement-strstr/) | [JavaScript](./src/implement-strstr/res.js) | Easy | diff --git a/src/swap-nodes-in-pairs/res.ts b/src/swap-nodes-in-pairs/res.ts new file mode 100644 index 0000000..315d52d --- /dev/null +++ b/src/swap-nodes-in-pairs/res.ts @@ -0,0 +1,40 @@ +/** + * Definition for singly-linked list. + */ +// @ts-ignore +class ListNode { + val: number + next: ListNode | null + constructor(val?: number, next?: ListNode | null) { + this.val = (val===undefined ? 0 : val) + this.next = (next===undefined ? null : next) + } +} + +function swapPairs(head: ListNode | null): ListNode | null { + if (!head?.next) { + return head; + } + + const result = head.next; + let prevPoint = null; + let currentPoint: ListNode | null = head; + while (currentPoint) { + const nextPoint = currentPoint.next; + const restPoint = nextPoint?.next as ListNode | null; + + if (nextPoint) { + currentPoint.next = restPoint; + nextPoint.next = currentPoint; + if (prevPoint) { + prevPoint.next = nextPoint; + } + prevPoint = currentPoint; + currentPoint = restPoint; + } else { + break; + } + } + + return result; +}; \ No newline at end of file From 744b754e6ccedfb319629de100153fb44da39c47 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Tue, 28 Jun 2022 11:35:10 +0800 Subject: [PATCH 28/53] update: 24-2 --- src/swap-nodes-in-pairs/res.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/swap-nodes-in-pairs/res.ts b/src/swap-nodes-in-pairs/res.ts index 315d52d..bc52b01 100644 --- a/src/swap-nodes-in-pairs/res.ts +++ b/src/swap-nodes-in-pairs/res.ts @@ -37,4 +37,15 @@ function swapPairs(head: ListNode | null): ListNode | null { } return result; -}; \ No newline at end of file +}; + +function swapPairs2(head: ListNode | null): ListNode | null { + if (!head?.next) { + return head; + } + + const result = head.next; + head.next = swapPairs(result.next); + result.next = head; + return result; +} \ No newline at end of file From ef80af099f47e9aea0079d218483ea7a2230bcfb Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Tue, 28 Jun 2022 11:40:46 +0800 Subject: [PATCH 29/53] update: 50 --- README.md | 1 + src/powx-n/res.ts | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 src/powx-n/res.ts diff --git a/README.md b/README.md index dd0ffb6..67c5481 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 46 | [Permutations](https://leetcode.com/problems/permutations/) | [JavaScript](./src/permutations/res.js) | Medium | | 48 | [Rotate Image](https://leetcode.com/problems/rotate-image/) | [JavaScript](./src/rotate-image/res.js) | Medium | | 49 | [Group Anagrams](https://leetcode.com/problems/anagrams/) | [JavaScript](./src/anagrams/res.js) | Medium | +| 50 | [powx-n](https://leetcode.com/problems/powx-n/) | [TypeScript](./src/powx-n/res.ts) | Medium | | 53 | [Maximum Subarray](https://leetcode.com/problems/maximum-subarray/) | [JavaScript](./src/maximum-subarray/res.js) · [TypeScript](./src/maximum-subarray/res.ts) | Easy | | 54 | [Spiral Matrix](https://leetcode.com/problems/spiral-matrix/) | [JavaScript](./src/spiral-matrix/res.js) | Medium | | 55 | [Jump Game](https://leetcode.com/problems/jump-game/) * | [JavaScript](./src/jump-game/res.js) | Medium | diff --git a/src/powx-n/res.ts b/src/powx-n/res.ts new file mode 100644 index 0000000..51101da --- /dev/null +++ b/src/powx-n/res.ts @@ -0,0 +1,15 @@ +function myPow(x: number, n: number): number { + if (n === 0) { + return 1; + } else if (n === 1) { + return x; + } else if (n > 0) { + if (n % 2 === 0) { + return myPow(x*x, n/2); + } else { + return x * myPow(x, n-1); + } + } else { + return 1 / myPow(x, -n); + } +}; \ No newline at end of file From 98f419fe000b4f9b3f61fd3f73fc5ebd928eecaf Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Tue, 28 Jun 2022 11:42:50 +0800 Subject: [PATCH 30/53] update: README --- README.md | 2 +- src/powx-n/res.ts | 5 +++++ src/swap-nodes-in-pairs/res.ts | 7 +++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 67c5481..b90e718 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr **ATTENTION**: If you also use JavaScript as your coding language, you should pay attention to some JavaScript INTERNAL issues, such as bitwise operators, so as to let you not drop into some trouble which may be caused by JavaScript itself. -**Progress: 152 Solutions** +**Progress: 156/2520 Solutions** | ID | Title | Solution | Difficulty | |-----|-------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|------------| diff --git a/src/powx-n/res.ts b/src/powx-n/res.ts index 51101da..abda4c2 100644 --- a/src/powx-n/res.ts +++ b/src/powx-n/res.ts @@ -1,3 +1,8 @@ +/** + * 迭代法或者递归法均可实现,本实现为递归法 + * @param x + * @param n + */ function myPow(x: number, n: number): number { if (n === 0) { return 1; diff --git a/src/swap-nodes-in-pairs/res.ts b/src/swap-nodes-in-pairs/res.ts index bc52b01..81b48ef 100644 --- a/src/swap-nodes-in-pairs/res.ts +++ b/src/swap-nodes-in-pairs/res.ts @@ -11,6 +11,9 @@ class ListNode { } } +/** + * 迭代法或者递归法均可实现,本实现为迭代法 + */ function swapPairs(head: ListNode | null): ListNode | null { if (!head?.next) { return head; @@ -39,6 +42,10 @@ function swapPairs(head: ListNode | null): ListNode | null { return result; }; +/** + * 递归法 + * @param head + */ function swapPairs2(head: ListNode | null): ListNode | null { if (!head?.next) { return head; From b1ebb0bbfe632fcb2c8b6b1023f66d4d1c1e19a3 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Tue, 28 Jun 2022 11:59:49 +0800 Subject: [PATCH 31/53] update: 143 --- README.md | 1 + src/reorder-list/res.ts | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 src/reorder-list/res.ts diff --git a/README.md b/README.md index b90e718..cef25f0 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 136 | [Single Number](https://leetcode.com/problems/single-number/) | [JavaScript](./src/single-number/res.js) | Easy | | 137 | [Single Number II](https://leetcode.com/problems/single-number-ii/) | [JavaScript](./src/single-number-ii/res.js) | Medium | | 139 | [word-break](https://leetcode.com/problems/word-break/) | [TypeScript](./src/word-break/res.ts) | Medium | +| 143 | [reorder-list](https://leetcode.com/problems/reorder-list/) | [TypeScript](./src/reorder-list/res.ts) | Medium | | 148 | [sort-list](https://leetcode.com/problems/sort-list/) | [TypeScript](./src/sort-list/res.ts) | Medium | | 151 | [Reverse Words in a String](https://leetcode.com/problems/reverse-words-in-a-string/) | [JavaScript](./src/reverse-words-in-a-string/res.js) | Medium | | 152 | [Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray/) | [JavaScript](./src/maximum-product-subarray/res.js) | Medium | diff --git a/src/reorder-list/res.ts b/src/reorder-list/res.ts new file mode 100644 index 0000000..0a7035e --- /dev/null +++ b/src/reorder-list/res.ts @@ -0,0 +1,35 @@ +/** + * Definition for singly-linked list. + * class ListNode { + * val: number + * next: ListNode | null + * constructor(val?: number, next?: ListNode | null) { + * this.val = (val===undefined ? 0 : val) + * this.next = (next===undefined ? null : next) + * } + * } + */ + +/** + Do not return anything, modify head in-place instead. + */ +function reorderList(head: ListNode | null): void { + if (!head?.next?.next) { + return ; + } + + let prevTailNode = head; + let tailNode = head; + while (tailNode.next) { + prevTailNode = tailNode; + tailNode = tailNode.next; + } + + const restNodes = head.next; + prevTailNode.next = null; + head.next = tailNode; + tailNode.next = restNodes; + reorderList(restNodes); + + return ; +}; \ No newline at end of file From c8cf9558818238838fcfa37825f13af5a60aa664 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Tue, 28 Jun 2022 12:12:54 +0800 Subject: [PATCH 32/53] update: 203 --- README.md | 1 + src/remove-linked-list-elements/res.ts | 42 ++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 src/remove-linked-list-elements/res.ts diff --git a/README.md b/README.md index cef25f0..098a114 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 190 | [Reverse Bits](https://leetcode.com/problems/reverse-bits/) | [JavaScript](./src/reverse-bits/res.js) | Easy | | 196 | [Delete Duplicate Emails](https://leetcode.com/problems/delete-duplicate-emails/) | [SQL](./src/delete-duplicate-emails/res.txt) | Easy | | 197 | [Rising Temperature](https://leetcode.com/problems/rising-temperature/) | [SQL](./src/rising-temperature/res.txt) | Easy | +| 203 | [remove-linked-list-elements](https://leetcode.com/problems/remove-linked-list-elements/) | [TypeScript](./src/remove-linked-list-elements/res.ts) | Easy | | 206 | [Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/) | [JavaScript](./src/reverse-linked-list/res.js) | Easy | | 207 | [Course Schedule](https://leetcode.com/problems/course-schedule/) | [JavaScript](./src/course-schedule/res.js) | Medium | | 209 | [Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum/) | [JavaScript](./src/minimum-size-subarray-sum/res.js) | Medium | diff --git a/src/remove-linked-list-elements/res.ts b/src/remove-linked-list-elements/res.ts new file mode 100644 index 0000000..0d07ec2 --- /dev/null +++ b/src/remove-linked-list-elements/res.ts @@ -0,0 +1,42 @@ +/** + * Definition for singly-linked list. + * class ListNode { + * val: number + * next: ListNode | null + * constructor(val?: number, next?: ListNode | null) { + * this.val = (val===undefined ? 0 : val) + * this.next = (next===undefined ? null : next) + * } + * } + */ + +/** + * 递归迭代均可,此法为迭代 + * @param head + * @param val + */ +function removeElements(head: ListNode | null, val: number): ListNode | null { + let result = head; + let prevPointer = null; + let currentPointer = head; + + if (!currentPointer) { + return result?.val === val ? null : head; + } + + while (currentPointer) { + if (currentPointer.val === val) { + if (prevPointer) { + prevPointer.next = currentPointer.next; + } else { + result = currentPointer.next; + } + } else { + prevPointer = currentPointer; + } + + currentPointer = currentPointer.next; + } + + return result; +}; \ No newline at end of file From 8094a7e1dc42105b9dd88baa0769d2a1553081ff Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Tue, 28 Jun 2022 15:05:10 +0800 Subject: [PATCH 33/53] update: 20 --- README.md | 1 + src/valid-parentheses/res.ts | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 src/valid-parentheses/res.ts diff --git a/README.md b/README.md index 098a114..335cccf 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 16 | [3Sum Closest](https://leetcode.com/problems/3sum-closest/) | [JavaScript](./src/3sum-closest/res.js) | Medium | | 17 | [Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/) | [JavaScript](./src/letter-combinations-of-a-phone-number/res.js) | Medium | | 19 | [Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) | [JavaScript](./src/remove-nth-node-from-end-of-list/res.js) | Medium | +| 20 | [valid-parentheses](https://leetcode.com/problems/valid-parentheses/) | [TypeScript](./src/valid-parentheses/res.ts) | Easy | | 22 | [Generate Parentheses](https://leetcode.com/problems/generate-parentheses/) | [JavaScript](./src/generate-parentheses/res.js) | Medium | | 24 | [swap-nodes-in-pairs](https://leetcode.com/problems/swap-nodes-in-pairs/) | [TypeScript](./src/swap-nodes-in-pairs/res.ts) | Medium | | 26 | [Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/) | [JavaScript](./src/remove-duplicates-from-sorted-array/res.js) | Easy | diff --git a/src/valid-parentheses/res.ts b/src/valid-parentheses/res.ts new file mode 100644 index 0000000..bab77d7 --- /dev/null +++ b/src/valid-parentheses/res.ts @@ -0,0 +1,26 @@ +function isValid(s: string): boolean { + const sLength = s.length; + if (sLength < 2) { + return !sLength; + } + + let stack: string[] = [s[0]]; + + for (let i = 1; i < sLength; i++) { + const current = s[i]; + if (['{', '(', '['].includes(current)) { + stack.push(current); + } else if (['}', ')', ']'].includes(current)) { + const matchedList = ['{}', '()', '[]']; + if (matchedList.includes(stack[stack.length-1] + current)) { + stack.pop(); + } else if (stack.length) { + break; + } else { + stack.push(current); + } + } + } + + return stack.length === 0; +}; \ No newline at end of file From 5d8872f73daf24a3f7e4af392c2942fcda683b47 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Tue, 28 Jun 2022 15:28:51 +0800 Subject: [PATCH 34/53] update: 38 --- README.md | 1 + src/count-and-say/res.ts | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 src/count-and-say/res.ts diff --git a/README.md b/README.md index 335cccf..7d260c8 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 33 | [Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/) | [JavaScript](./src/search-in-rotated-sorted-array/res.js) | Medium | | 34 | [Search for a Range](https://leetcode.com/problems/search-for-a-range/) | [JavaScript](./src/search-for-a-range/res.js) | Medium | | 35 | [Search Insert Position](https://leetcode.com/problems/search-insert-position/) | [JavaScript](./src/search-insert-position/res.js) | Easy | +| 38 | [count-and-say](https://leetcode.com/problems/count-and-say/) | [TypeScript](./src/count-and-say/res.ts) | Medium | | 39 | [Combination Sum](https://leetcode.com/problems/combination-sum/) | [JavaScript](./src/combination-sum/res.js) | Medium | | 40 | [Combination Sum II](https://leetcode.com/problems/combination-sum-ii/) | [JavaScript](./src/combination-sum-ii/res.js) | Medium | | 41 | [First Missing Positive](https://leetcode.com/problems/first-missing-positive/description/) | [JavaScript](./src/first-missing-positive/res.js) | Hard | diff --git a/src/count-and-say/res.ts b/src/count-and-say/res.ts new file mode 100644 index 0000000..26ec9fb --- /dev/null +++ b/src/count-and-say/res.ts @@ -0,0 +1,28 @@ +function countAndSay(n: number): string { + let result = '1'; + + for (let i = 1; i < n; i++) { + let newResult: string = ''; + let stackList: string[] = result.split(''); + + let currentCount = 1; + let currentChar = stackList[0]; + for (let j = 1; j < stackList.length; j++) { + if (currentChar === stackList[j]) { + currentCount++; + } else { + newResult += `${currentCount}${currentChar}`; + currentChar = stackList[j]; + currentCount = 1; + } + } + + if (currentCount) { + newResult += `${currentCount}${currentChar}`; + } + + result = newResult; + } + + return result; +}; \ No newline at end of file From 56dc330a5ef3e5ce17f060fec9f04ca630da2faf Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Tue, 28 Jun 2022 17:47:37 +0800 Subject: [PATCH 35/53] update: 166 --- README.md | 1 + src/fraction-to-recurring-decimal/res.ts | 46 ++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 src/fraction-to-recurring-decimal/res.ts diff --git a/README.md b/README.md index 7d260c8..9a13b75 100644 --- a/README.md +++ b/README.md @@ -101,6 +101,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 162 | [Find Peak Element](https://leetcode.com/problems/find-peak-element/) | [JavaScript](./src/find-peak-element/res.js) | Medium | | 164 | [Maximum Gap](https://leetcode.com/problems/maximum-gap/) | [JavaScript](./src/maximum-gap/res.js) | Hard | | 165 | [Compare Version Numbers](https://leetcode.com/problems/compare-version-numbers/) | [JavaScript](./src/compare-version-numbers/res.js) | Medium | +| 166 | [fraction-to-recurring-decimal](https://leetcode.com/problems/fraction-to-recurring-decimal/) | [TypeScript](./src/fraction-to-recurring-decimal/res.ts) | Medium | | 169 | [Majority Element](https://leetcode.com/problems/majority-element/) | [JavaScript](./src/majority-element/res.js) | Easy | | 175 | [Combine Two Tables](https://leetcode.com/problems/combine-two-tables/) | [SQL](./src/combine-two-tables/res.txt) | Easy | | 176 | [Second Highest Salary](https://leetcode.com/problems/second-highest-salary/) | [SQL](./src/second-highest-salary/res.txt) | Easy | diff --git a/src/fraction-to-recurring-decimal/res.ts b/src/fraction-to-recurring-decimal/res.ts new file mode 100644 index 0000000..e2dc608 --- /dev/null +++ b/src/fraction-to-recurring-decimal/res.ts @@ -0,0 +1,46 @@ +function fractionToDecimal(numerator: number, denominator: number): string { + if (numerator === 0) { + return '0'; + } + + let result: string[] = []; + const remainderMap: { [key in number]: number } = {}; + + if (numerator * denominator < 0) { + result.push('-'); + } + numerator = Math.abs(numerator); + denominator = Math.abs(denominator); + + const integerPart = Math.floor(numerator / denominator); + result.push(String(integerPart), '.'); + numerator = (numerator % denominator) * 10; + + while (numerator && numerator < denominator) { + result.push('0'); + remainderMap[numerator] = result.length - 1; + numerator *= 10; + } + + let currentRemainder = numerator; + while (currentRemainder) { + if (remainderMap[currentRemainder]) { + const remainderIndex = remainderMap[currentRemainder]; + const remainderRepeatString = result.slice(remainderIndex).join(''); + result = [...result.slice(0, remainderIndex), '(', remainderRepeatString, ')']; + break; + } else { + const newRemainder = currentRemainder % denominator; + const divideItem = Math.floor(currentRemainder / denominator); + remainderMap[currentRemainder] = result.length; + result.push(divideItem.toString()); + currentRemainder = newRemainder * 10; + } + } + + if (result[result.length-1] === '.' || result.indexOf('.') === 0) { + return result.join('').replace('.', ''); + } + + return result.join(''); +}; \ No newline at end of file From 4cb43838843dc23d856c006b8757405a54869ad8 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Wed, 29 Jun 2022 15:47:34 +0800 Subject: [PATCH 36/53] update: 47 --- README.md | 1 + src/permutations-ii/res.ts | 47 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 src/permutations-ii/res.ts diff --git a/README.md b/README.md index 9a13b75..d871096 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 43 | [Multiply Strings](https://leetcode.com/problems/multiply-strings/) | [JavaScript](./src/multiply-strings/res.js) | Medium | | 45 | [Jump Game II](https://leetcode.com/problems/jump-game-ii/) | [JavaScript](./src/jump-game-ii/res.js) | Hard | | 46 | [Permutations](https://leetcode.com/problems/permutations/) | [JavaScript](./src/permutations/res.js) | Medium | +| 47 | [permutations-ii](https://leetcode.com/problems/permutations-ii/) | [TypeScript](./src/permutations-ii/res.ts) | Medium | | 48 | [Rotate Image](https://leetcode.com/problems/rotate-image/) | [JavaScript](./src/rotate-image/res.js) | Medium | | 49 | [Group Anagrams](https://leetcode.com/problems/anagrams/) | [JavaScript](./src/anagrams/res.js) | Medium | | 50 | [powx-n](https://leetcode.com/problems/powx-n/) | [TypeScript](./src/powx-n/res.ts) | Medium | diff --git a/src/permutations-ii/res.ts b/src/permutations-ii/res.ts new file mode 100644 index 0000000..7f853ec --- /dev/null +++ b/src/permutations-ii/res.ts @@ -0,0 +1,47 @@ +function getUniqueList(numsCountMap: { [key in number]: number }): number[][] { + const result: number[][] = []; + + const keys = Object.keys(numsCountMap); + + keys.forEach((key) => { + // @ts-ignore + const currentCount = numsCountMap[key]; + const currentNum = Number(key); + + if (currentCount) { + const newNumsCountMap = { ...numsCountMap }; + newNumsCountMap[key]--; + for (let newKey in newNumsCountMap) { + if (!newNumsCountMap[newKey]) { + delete newNumsCountMap[newKey]; + } + } + + const uniqueList = getUniqueList(newNumsCountMap); + + if (!uniqueList.length) { + result.push([currentNum]); + } else { + uniqueList.forEach((item) => { + result.push([currentNum, ...item]); + }); + } + } + }) + + return result; +} + +function permuteUnique(nums: number[]): number[][] { + const numsCountMap: { [key in number]: number } = {}; + nums.sort((a, b) => a - b); + nums.forEach((num, index) => { + numsCountMap[num] = numsCountMap[num] ? numsCountMap[num] + 1 : 1; + }); + + if (nums.length <= 1) { + return [nums]; + } + + return getUniqueList(numsCountMap); +}; \ No newline at end of file From 513b98ff970e139f4a0d12e951a966ecf1959607 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Wed, 29 Jun 2022 16:20:55 +0800 Subject: [PATCH 37/53] update: 77 --- README.md | 1 + src/combinations/res.ts | 26 ++++++++++++++++++++++++++ src/permutations-ii/res.ts | 1 + 3 files changed, 28 insertions(+) create mode 100644 src/combinations/res.ts diff --git a/README.md b/README.md index d871096..3f764df 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 71 | [Simplify Path](https://leetcode.com/problems/simplify-path/) | [JavaScript](./src/simplify-path/res.js) | Medium | | 73 | [Set Matrix Zeroes](https://leetcode.com/problems/set-matrix-zeroes/) | [JavaScript](./src/set-matrix-zeroes/res.js) | Medium | | 75 | [Sort Colors](https://leetcode.com/problems/sort-colors/) | [JavaScript](./src/sort-colors/res.js) | Medium | +| 77 | [combinations](https://leetcode.com/problems/combinations/) | [TypeScript](./src/combinations/res.ts) | Medium | | 80 | [Remove Duplicates from Sorted Array II](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/) | [JavaScript](./src/remove-duplicates-from-sorted-array-ii/res.js) | Medium | | 81 | [Search in Rotated Sorted Array II](https://leetcode.com/problems/search-in-rotated-sorted-array-ii/) | [JavaScript](./src/search-in-rotated-sorted-array-ii/res.js) | Medium | | 88 | [ Merge Sorted Array](https://leetcode.com/problems/merge-sorted-array/) | [JavaScript](./src/merge-sorted-array/res.js) | Medium | diff --git a/src/combinations/res.ts b/src/combinations/res.ts new file mode 100644 index 0000000..925b016 --- /dev/null +++ b/src/combinations/res.ts @@ -0,0 +1,26 @@ +function iterateNums(nums: number[], k: number): number[][] { + if (k === 0) { + return []; + } + + const result: number[][] = []; + nums.forEach((num, index) => { + const newNums = nums.slice(index+1); + const newResult = iterateNums([...newNums], k - 1); + + if (newResult.length) { + newResult.forEach(item => { + result.push([num, ...item]); + }); + } else { + result.push([num]); + } + }); + + return result.filter(item => item.length === k); +} + +function combine(n: number, k: number): number[][] { + const nums = (new Array(n).fill(0)).map((_, index) => index + 1); + return iterateNums(nums, k); +}; \ No newline at end of file diff --git a/src/permutations-ii/res.ts b/src/permutations-ii/res.ts index 7f853ec..8fc5dd9 100644 --- a/src/permutations-ii/res.ts +++ b/src/permutations-ii/res.ts @@ -10,6 +10,7 @@ function getUniqueList(numsCountMap: { [key in number]: number }): number[][] { if (currentCount) { const newNumsCountMap = { ...numsCountMap }; + // @ts-ignore newNumsCountMap[key]--; for (let newKey in newNumsCountMap) { if (!newNumsCountMap[newKey]) { From 0df24de1dd0d7fe68fdb09bb9f5f48b1f9d0bf29 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Fri, 1 Jul 2022 15:44:00 +0800 Subject: [PATCH 38/53] update: 99 --- README.md | 1 + src/recover-binary-search-tree/res.ts | 65 +++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 src/recover-binary-search-tree/res.ts diff --git a/README.md b/README.md index 3f764df..df92761 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 96 | [unique-binary-search-trees](https://leetcode.com/problems/unique-binary-search-trees/) | [TypeScript](./src/unique-binary-search-trees/res.ts) | Medium | | 97 | [interleaving-string](https://leetcode.com/problems/interleaving-string/) | [TypeScript](./src/interleaving-string/res.ts) | Medium | | 98 | [Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/) | [JavaScript](./src/validate-binary-search-tree/res.js) | Medium | +| 99 | [recover-binary-search-tree](https://leetcode.com/problems/recover-binary-search-tree/) | [TypeScript](./src/recover-binary-search-tree/res.ts) | Medium | | 100 | [Same Tree](https://leetcode.com/problems/same-tree/) | [JavaScript](./src/same-tree/res.js) | Easy | | 101 | [Symmetric Tree](https://leetcode.com/problems/symmetric-tree/) | [JavaScript](./src/symmetric-tree/res.js) | Easy | | 102 | [Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/) | [JavaScript](./src/binary-tree-level-order-traversal/res.js) | Medium | diff --git a/src/recover-binary-search-tree/res.ts b/src/recover-binary-search-tree/res.ts new file mode 100644 index 0000000..23dea7a --- /dev/null +++ b/src/recover-binary-search-tree/res.ts @@ -0,0 +1,65 @@ +/** + * Definition for a binary tree node. + * class TreeNode { + * val: number + * left: TreeNode | null + * right: TreeNode | null + * constructor(val?: number, left?: TreeNode | null, right?: TreeNode | null) { + * this.val = (val===undefined ? 0 : val) + * this.left = (left===undefined ? null : left) + * this.right = (right===undefined ? null : right) + * } + * } + */ + +const inorder = (root: TreeNode | null, nums: number[]) => { + if (!root) { + return ; + } + + inorder(root.left, nums); + nums.push(root.val); + inorder(root.right, nums); +} + +const findSwapTwoNums = (root: TreeNode | null, nums: number[]) => { + let x = -1, y = -1; + for (let i = 1; i < nums.length; i++) { + if (nums[i] < nums[i-1]) { + y = i; + + if (x === -1) { + x = i-1; + } else { + break; + } + } + } + + return [nums[x], nums[y]]; +} + +const recover = (root: TreeNode | null, index: number, x: number, y: number) => { + if (!root || index === 0) { + return ; + } + + if ([x, y].includes(root.val)) { + root.val = root.val === x ? y : x; + index--; + } + + recover(root.left, index, x, y); + recover(root.right, index, x, y); +} + +/** + Do not return anything, modify root in-place instead. + */ +function recoverTree(root: TreeNode | null): void { + const nums: number[] = []; + + inorder(root, nums); + const [x, y] = findSwapTwoNums(root, nums); + recover(root, 2, x, y); +}; \ No newline at end of file From 74ef4e40e56b5be887eab4106f90287b9b044d9e Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Fri, 1 Jul 2022 16:07:02 +0800 Subject: [PATCH 39/53] update: 95 --- README.md | 1 + src/unique-binary-search-trees-ii/res.ts | 45 ++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 src/unique-binary-search-trees-ii/res.ts diff --git a/README.md b/README.md index df92761..68c6804 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 91 | [Decode Ways](https://leetcode.com/problems/decode-ways/) | [JavaScript](./src/decode-ways/res.js) | Medium | | 93 | [Restore IP Addresses](https://leetcode.com/problems/restore-ip-addresses/) | [JavaScript](./src/restore-ip-addresses/res.js) | Medium | | 94 | [Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal/) | [TypeScript](./src/binary-tree-inorder-traversal/res.ts) | Easy | +| 95 | [unique-binary-search-trees-ii](https://leetcode.com/problems/unique-binary-search-trees-ii/) | [TypeScript](./src/unique-binary-search-trees-ii/res.ts) | Medium | | 96 | [unique-binary-search-trees](https://leetcode.com/problems/unique-binary-search-trees/) | [TypeScript](./src/unique-binary-search-trees/res.ts) | Medium | | 97 | [interleaving-string](https://leetcode.com/problems/interleaving-string/) | [TypeScript](./src/interleaving-string/res.ts) | Medium | | 98 | [Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/) | [JavaScript](./src/validate-binary-search-tree/res.js) | Medium | diff --git a/src/unique-binary-search-trees-ii/res.ts b/src/unique-binary-search-trees-ii/res.ts new file mode 100644 index 0000000..b12953d --- /dev/null +++ b/src/unique-binary-search-trees-ii/res.ts @@ -0,0 +1,45 @@ +/** + * Definition for a binary tree node. + * class TreeNode { + * val: number + * left: TreeNode | null + * right: TreeNode | null + * constructor(val?: number, left?: TreeNode | null, right?: TreeNode | null) { + * this.val = (val===undefined ? 0 : val) + * this.left = (left===undefined ? null : left) + * this.right = (right===undefined ? null : right) + * } + * } + */ + +function getTrees(nums: number[]): Array { + if (!nums.length) { + return [null]; + } + + const result = []; + + for (let i = 0; i < nums.length; i++) { + const currentVal = nums[i]; + + const leftTrees = getTrees(nums.slice(0, i)); + const rightTrees = getTrees(nums.slice(i + 1)); + + for (let j = 0; j < leftTrees.length; j++) { + for (let k = 0; k < rightTrees.length; k++) { + const rootNode = new TreeNode(currentVal); + rootNode.left = leftTrees[j]; + rootNode.right = rightTrees[k]; + result.push(rootNode); + } + } + } + + return result.filter(Boolean); +} + +function generateTrees(n: number): Array { + const nums = new Array(n).fill(0).map((_, i) => i + 1); + + return getTrees(nums); +}; \ No newline at end of file From 9ddaf94e9ed87038429d576d485d556ac10f6f07 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Fri, 1 Jul 2022 16:15:42 +0800 Subject: [PATCH 40/53] update: 95 --- src/sum-root-to-leaf-numbers/res.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/sum-root-to-leaf-numbers/res.ts diff --git a/src/sum-root-to-leaf-numbers/res.ts b/src/sum-root-to-leaf-numbers/res.ts new file mode 100644 index 0000000..e69de29 From 95c2db49bfe378ffcd0618b23600db790fa031e7 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Fri, 1 Jul 2022 16:15:46 +0800 Subject: [PATCH 41/53] update: 129 --- README.md | 1 + src/sum-root-to-leaf-numbers/res.ts | 35 +++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/README.md b/README.md index 68c6804..9295bb4 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 123 | [Best Time to Buy and Sell Stock III](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/) * | [JavaScript](./src/best-time-to-buy-and-sell-stock-iii/res.js) | Hard | | 127 | [Word Ladder](https://leetcode.com/problems/word-ladder/) | [JavaScript](./src/word-ladder/res.js) | Medium | | 128 | [Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence/) | [JavaScript](./src/longest-consecutive-sequence/res.js) | Medium | +| 129 | [sum-root-to-leaf-numbers](https://leetcode.com/problems/sum-root-to-leaf-numbers/) | [TypeScript](./src/sum-root-to-leaf-numbers/res.ts) | Medium | | 130 | [Surrounded Regions](https://leetcode.com/problems/surrounded-regions/) | [JavaScript](./src/surrounded-regions/res.js) | Medium | | 131 | [palindrome-partitioning](https://leetcode.com/problems/palindrome-partitioning/) | [TypeScript](./src/palindrome-partitioning/res.ts) | Medium | | 133 | [Clone Graph](https://leetcode.com/problems/clone-graph/) | [JavaScript](./src/clone-graph/res.js) | Medium | diff --git a/src/sum-root-to-leaf-numbers/res.ts b/src/sum-root-to-leaf-numbers/res.ts index e69de29..379e3cf 100644 --- a/src/sum-root-to-leaf-numbers/res.ts +++ b/src/sum-root-to-leaf-numbers/res.ts @@ -0,0 +1,35 @@ +/** + * Definition for a binary tree node. + * class TreeNode { + * val: number + * left: TreeNode | null + * right: TreeNode | null + * constructor(val?: number, left?: TreeNode | null, right?: TreeNode | null) { + * this.val = (val===undefined ? 0 : val) + * this.left = (left===undefined ? null : left) + * this.right = (right===undefined ? null : right) + * } + * } + */ + +function sumNumbers(root: TreeNode | null): number { + const result: number[][] = []; + + const dfs = (root: TreeNode | null, nums: number[]) => { + if (!root) { + return ; + } + + if (!root.left && !root.right) { + result.push([...nums, root.val]); + return ; + } + + dfs(root.left, [...nums, root.val]); + dfs(root.right, [...nums, root.val]); + } + + dfs(root, []); + + return result.map(item => parseInt(item.join(''))).reduce((a, b) => a + b); +}; \ No newline at end of file From d8a09edb307dec7255d5127d9ac0e2c9d91a37cc Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Fri, 1 Jul 2022 16:29:44 +0800 Subject: [PATCH 42/53] update: 230 --- README.md | 1 + src/kth-smallest-element-in-a-bst/res.ts | 33 ++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 src/kth-smallest-element-in-a-bst/res.ts diff --git a/README.md b/README.md index 9295bb4..eccf9c7 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 219 | [Contains Duplicate II](https://leetcode.com/problems/contains-duplicate-ii/) | [JavaScript](./src/contains-duplicate-ii/res.js) | Easy | | 220 | [Contains Duplicate III](https://leetcode.com/problems/contains-duplicate-iii/) | [JavaScript](./src/contains-duplicate-iii/res.js) | Medium | | 228 | [Summary Ranges](https://leetcode.com/problems/summary-ranges/solution/) | [JavaScript](./src/summary-ranges/res.js) | Medium | +| 230 | [kth-smallest-element-in-a-bst](https://leetcode.com/problems/kth-smallest-element-in-a-bst/solution/) | [TypeScript](./src/kth-smallest-element-in-a-bst/res.ts) | Medium | | 238 | [Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/solution/) | [JavaScript](./src/product-of-array-except-self/res.js) | Medium | | 239 | [Sliding Window Maximum](https://leetcode.com/problems/sliding-window-maximum/description/) | [JavaScript](./src/sliding-window-maximum/description/res.js) | Hard | | 240 | [Search a 2D Matrix II](https://leetcode.com/problems/search-a-2d-matrix-ii/) | [JavaScript](./src/search-a-2d-matrix-ii/res.js) · [TypeScript](./src/search-a-2d-matrix-ii/res.ts) | Medium | diff --git a/src/kth-smallest-element-in-a-bst/res.ts b/src/kth-smallest-element-in-a-bst/res.ts new file mode 100644 index 0000000..bc9dce8 --- /dev/null +++ b/src/kth-smallest-element-in-a-bst/res.ts @@ -0,0 +1,33 @@ +/** + * Definition for a binary tree node. + * class TreeNode { + * val: number + * left: TreeNode | null + * right: TreeNode | null + * constructor(val?: number, left?: TreeNode | null, right?: TreeNode | null) { + * this.val = (val===undefined ? 0 : val) + * this.left = (left===undefined ? null : left) + * this.right = (right===undefined ? null : right) + * } + * } + */ + +const getTreeList = (root: TreeNode | null): number[] => { + if (!root) { + return []; + } + + const result = []; + + result.push(...getTreeList(root.left)); + result.push(root.val); + result.push(...getTreeList(root.right)); + + return result; +} + +function kthSmallest(root: TreeNode | null, k: number): number { + const result = getTreeList(root); + + return result[k-1]; +}; \ No newline at end of file From bef9603f5c1f5e627031f204da5c6c56fa7d5665 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Mon, 4 Jul 2022 15:58:32 +0800 Subject: [PATCH 43/53] update: 18 --- README.md | 1 + src/4sum/res.ts | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 src/4sum/res.ts diff --git a/README.md b/README.md index eccf9c7..31f492a 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 15 | [3Sum](https://leetcode.com/problems/3sum/) | [JavaScript](./src/3sum/res.js) | Medium | | 16 | [3Sum Closest](https://leetcode.com/problems/3sum-closest/) | [JavaScript](./src/3sum-closest/res.js) | Medium | | 17 | [Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/) | [JavaScript](./src/letter-combinations-of-a-phone-number/res.js) | Medium | +| 18 | [4sum](https://leetcode.com/problems/4sum/) | [TypeScript](./src/4sum/res.ts) | Medium | | 19 | [Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) | [JavaScript](./src/remove-nth-node-from-end-of-list/res.js) | Medium | | 20 | [valid-parentheses](https://leetcode.com/problems/valid-parentheses/) | [TypeScript](./src/valid-parentheses/res.ts) | Easy | | 22 | [Generate Parentheses](https://leetcode.com/problems/generate-parentheses/) | [JavaScript](./src/generate-parentheses/res.js) | Medium | diff --git a/src/4sum/res.ts b/src/4sum/res.ts new file mode 100644 index 0000000..f60fe1b --- /dev/null +++ b/src/4sum/res.ts @@ -0,0 +1,44 @@ +function fourSum(nums: number[], target: number): number[][] { + const res: number[][] = []; + + if (nums.length < 4) { + return res; + } + + nums.sort((a, b) => a - b); + + for (let i = 0; i < nums.length-3; i++) { + if (i-1 >=0 && nums[i] === nums[i-1]) { + continue; + } + for (let j = i+1; j < nums.length-2; j++) { + if (j > i+1 && nums[j] === nums[j-1]) { + continue; + } + + let k = j+1, l = nums.length-1; + while (k < l) { + const sum = nums[i] + nums[j] + nums[k] + nums[l]; + + if (sum === target) { + res.push([nums[i], nums[j], nums[k], nums[l]]); + + while (k < l && nums[k] === nums[k+1]) { + k++; + } + while (k < l && nums[l] === nums[l-1]) { + l--; + } + k++; + l--; + } else if (sum < target) { + k++; + } else if (sum > target) { + l--; + } + } + } + } + + return res; +}; \ No newline at end of file From 06c0af1b29db81d785a3423ec81bfa38c25fdc84 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Mon, 4 Jul 2022 18:34:11 +0800 Subject: [PATCH 44/53] update: 31 --- README.md | 1 + src/next-permutation/res.ts | 47 +++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 src/next-permutation/res.ts diff --git a/README.md b/README.md index 31f492a..11fa4ef 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 27 | [Remove Element](https://leetcode.com/problems/remove-element/) | [JavaScript](./src/remove-element/res.js) | Easy | | 28 | [Implement strStr()](https://leetcode.com/problems/implement-strstr/) | [JavaScript](./src/implement-strstr/res.js) | Easy | | 29 | [Divide Two Integers](https://leetcode.com/problems/divide-two-integers/) | [JavaScript](./src/divide-two-integers/res.js) | Medium | +| 31 | [next-permutation](https://leetcode.com/problems/next-permutation/) | [TypeScript](./src/next-permutation/res.ts) | Medium | | 33 | [Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/) | [JavaScript](./src/search-in-rotated-sorted-array/res.js) | Medium | | 34 | [Search for a Range](https://leetcode.com/problems/search-for-a-range/) | [JavaScript](./src/search-for-a-range/res.js) | Medium | | 35 | [Search Insert Position](https://leetcode.com/problems/search-insert-position/) | [JavaScript](./src/search-insert-position/res.js) | Easy | diff --git a/src/next-permutation/res.ts b/src/next-permutation/res.ts new file mode 100644 index 0000000..9481042 --- /dev/null +++ b/src/next-permutation/res.ts @@ -0,0 +1,47 @@ +/** + Do not return anything, modify nums in-place instead. + */ +function nextPermutation(nums: number[]): void { + let currentPointer = nums.length - 1; + let mutationCount = 0; + + if (currentPointer < 1) { + return ; + } + + while (!mutationCount || currentPointer <= nums.length-1 && currentPointer > 0) { + mutationCount++; + if (currentPointer > 0 && nums[currentPointer] > nums[currentPointer-1]) { + currentPointer--; + break; + } + + currentPointer--; + } + + let swapPointer = nums.length-1; + while(swapPointer > 0 && nums[swapPointer] <= nums[currentPointer]) { + swapPointer--; + } + + if (!currentPointer && !swapPointer) { + nums.sort((a, b) => a - b); + } else if (currentPointer === nums.length-2) { + const swapPointer = currentPointer+1; + const swapValue = nums[swapPointer]; + nums[swapPointer] = nums[currentPointer]; + nums[currentPointer] = swapValue; + } else { + // swap + const swapValue = nums[swapPointer]; + nums[swapPointer] = nums[currentPointer]; + nums[currentPointer] = swapValue; + + const restList = nums.slice(currentPointer + 1); + restList.sort((a, b) => a - b); + + for (let j = currentPointer + 1; j < nums.length; j++) { + nums[j] = restList[j-currentPointer-1]; + } + } +}; \ No newline at end of file From 77a8a2857db5ae2430334252dfe91866be633b41 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Mon, 4 Jul 2022 19:57:39 +0800 Subject: [PATCH 45/53] update: 121 --- README.md | 344 ++++++++++----------- src/best-time-to-buy-and-sell-stock/res.ts | 43 +++ 2 files changed, 215 insertions(+), 172 deletions(-) create mode 100644 src/best-time-to-buy-and-sell-stock/res.ts diff --git a/README.md b/README.md index 11fa4ef..cf067d5 100644 --- a/README.md +++ b/README.md @@ -6,175 +6,175 @@ This is the solutions collection of my LeetCode submissions, most of them are pr **Progress: 156/2520 Solutions** -| ID | Title | Solution | Difficulty | -|-----|-------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|------------| -| 1 | [Two Sum](https://leetcode.com/problems/two-sum/) | [JavaScript](./src/two-sum/res.js) | Easy | -| 2 | [Add Two Numbers](https://leetcode.com/problems/add-two-numbers/) | [JavaScript](./src/add-two-numbers/res.js) | Medium | -| 3 | [Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | [JavaScript](./src/longest-substring-without-repeating-characters/res.js) | Medium | -| 4 | [Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/) | [JavaScript](./src/median-of-two-sorted-arrays/res.js) | Hard | -| 5 | [Longest Palindromic Substring](https://leetcode.com/problems/longest-palindromic-substring/) | [JavaScript](./src/longest-palindromic-substring/res.js) | Medium | -| 6 | [ZigZag Conversion](https://leetcode.com/problems/zigzag-conversion/) | [JavaScript](./src/zigzag-conversion/res.js) | Medium | -| 7 | [Reverse Integer](https://leetcode.com/problems/reverse-integer/) | [JavaScript](./src/reverse-integer/res.js) | Easy | -| 8 | [String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi/) | [JavaScript](./src/string-to-integer-atoi/res.js) | Medium | -| 11 | [Container With Most Water](https://leetcode.com/problems/container-with-most-water/) | [JavaScript](./src/container-with-most-water/res.js) | Medium | -| 13 | [Roman to Integer](https://leetcode.com/problems/roman-to-integer/) | [JavaScript](./src/roman-to-integer/res.js) | Easy | -| 14 | [Longest Common Prefix](https://leetcode.com/problems/longest-common-prefix/) | [JavaScript](./src/longest-common-prefix/res.js) | Easy | -| 15 | [3Sum](https://leetcode.com/problems/3sum/) | [JavaScript](./src/3sum/res.js) | Medium | -| 16 | [3Sum Closest](https://leetcode.com/problems/3sum-closest/) | [JavaScript](./src/3sum-closest/res.js) | Medium | -| 17 | [Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/) | [JavaScript](./src/letter-combinations-of-a-phone-number/res.js) | Medium | -| 18 | [4sum](https://leetcode.com/problems/4sum/) | [TypeScript](./src/4sum/res.ts) | Medium | -| 19 | [Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) | [JavaScript](./src/remove-nth-node-from-end-of-list/res.js) | Medium | -| 20 | [valid-parentheses](https://leetcode.com/problems/valid-parentheses/) | [TypeScript](./src/valid-parentheses/res.ts) | Easy | -| 22 | [Generate Parentheses](https://leetcode.com/problems/generate-parentheses/) | [JavaScript](./src/generate-parentheses/res.js) | Medium | -| 24 | [swap-nodes-in-pairs](https://leetcode.com/problems/swap-nodes-in-pairs/) | [TypeScript](./src/swap-nodes-in-pairs/res.ts) | Medium | -| 26 | [Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/) | [JavaScript](./src/remove-duplicates-from-sorted-array/res.js) | Easy | -| 27 | [Remove Element](https://leetcode.com/problems/remove-element/) | [JavaScript](./src/remove-element/res.js) | Easy | -| 28 | [Implement strStr()](https://leetcode.com/problems/implement-strstr/) | [JavaScript](./src/implement-strstr/res.js) | Easy | -| 29 | [Divide Two Integers](https://leetcode.com/problems/divide-two-integers/) | [JavaScript](./src/divide-two-integers/res.js) | Medium | -| 31 | [next-permutation](https://leetcode.com/problems/next-permutation/) | [TypeScript](./src/next-permutation/res.ts) | Medium | -| 33 | [Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/) | [JavaScript](./src/search-in-rotated-sorted-array/res.js) | Medium | -| 34 | [Search for a Range](https://leetcode.com/problems/search-for-a-range/) | [JavaScript](./src/search-for-a-range/res.js) | Medium | -| 35 | [Search Insert Position](https://leetcode.com/problems/search-insert-position/) | [JavaScript](./src/search-insert-position/res.js) | Easy | -| 38 | [count-and-say](https://leetcode.com/problems/count-and-say/) | [TypeScript](./src/count-and-say/res.ts) | Medium | -| 39 | [Combination Sum](https://leetcode.com/problems/combination-sum/) | [JavaScript](./src/combination-sum/res.js) | Medium | -| 40 | [Combination Sum II](https://leetcode.com/problems/combination-sum-ii/) | [JavaScript](./src/combination-sum-ii/res.js) | Medium | -| 41 | [First Missing Positive](https://leetcode.com/problems/first-missing-positive/description/) | [JavaScript](./src/first-missing-positive/res.js) | Hard | -| 42 | [ Trapping Rain Water](https://leetcode.com/problems/trapping-rain-water/description/) | [JavaScript](./src/trapping-rain-water/res.js) | Hard | -| 43 | [Multiply Strings](https://leetcode.com/problems/multiply-strings/) | [JavaScript](./src/multiply-strings/res.js) | Medium | -| 45 | [Jump Game II](https://leetcode.com/problems/jump-game-ii/) | [JavaScript](./src/jump-game-ii/res.js) | Hard | -| 46 | [Permutations](https://leetcode.com/problems/permutations/) | [JavaScript](./src/permutations/res.js) | Medium | -| 47 | [permutations-ii](https://leetcode.com/problems/permutations-ii/) | [TypeScript](./src/permutations-ii/res.ts) | Medium | -| 48 | [Rotate Image](https://leetcode.com/problems/rotate-image/) | [JavaScript](./src/rotate-image/res.js) | Medium | -| 49 | [Group Anagrams](https://leetcode.com/problems/anagrams/) | [JavaScript](./src/anagrams/res.js) | Medium | -| 50 | [powx-n](https://leetcode.com/problems/powx-n/) | [TypeScript](./src/powx-n/res.ts) | Medium | -| 53 | [Maximum Subarray](https://leetcode.com/problems/maximum-subarray/) | [JavaScript](./src/maximum-subarray/res.js) · [TypeScript](./src/maximum-subarray/res.ts) | Easy | -| 54 | [Spiral Matrix](https://leetcode.com/problems/spiral-matrix/) | [JavaScript](./src/spiral-matrix/res.js) | Medium | -| 55 | [Jump Game](https://leetcode.com/problems/jump-game/) * | [JavaScript](./src/jump-game/res.js) | Medium | -| 56 | [Merge Intervals](https://leetcode.com/problems/merge-intervals/) | [JavaScript](./src/merge-intervals/res.js) | Medium | -| 57 | [Insert Interval](https://leetcode.com/problems/insert-interval/) | [JavaScript](./src/insert-interval/res.js) | Hard | -| 62 | [Unique Paths](https://leetcode.com/problems/unique-paths/) | [JavaScript](./src/unique-paths/res.js) | Medium | -| 63 | [Unique Paths ii](https://leetcode.com/problems/unique-paths-ii/) | [JavaScript](./src/unique-paths-ii/res.js) | Medium | -| 64 | [minimum-path-sum](https://leetcode.com/problems/minimum-path-sum/) | [TypeScript](./src/minimum-path-sum/res.ts) | Medium | -| 66 | [Plus One](https://leetcode.com/problems/plus-one/) | [JavaScript](./src/plus-one/res.js) | Easy | -| 69 | [Sqrt(x)](https://leetcode.com/problems/sqrtx/) | [JavaScript](./src/sqrtx/res.js) | Easy | -| 70 | [climbing-stairs](https://leetcode.com/problems/climbing-stairs/) | [TypeScript](./src/climbing-stairs/res.ts) | Easy | -| 71 | [Simplify Path](https://leetcode.com/problems/simplify-path/) | [JavaScript](./src/simplify-path/res.js) | Medium | -| 73 | [Set Matrix Zeroes](https://leetcode.com/problems/set-matrix-zeroes/) | [JavaScript](./src/set-matrix-zeroes/res.js) | Medium | -| 75 | [Sort Colors](https://leetcode.com/problems/sort-colors/) | [JavaScript](./src/sort-colors/res.js) | Medium | -| 77 | [combinations](https://leetcode.com/problems/combinations/) | [TypeScript](./src/combinations/res.ts) | Medium | -| 80 | [Remove Duplicates from Sorted Array II](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/) | [JavaScript](./src/remove-duplicates-from-sorted-array-ii/res.js) | Medium | -| 81 | [Search in Rotated Sorted Array II](https://leetcode.com/problems/search-in-rotated-sorted-array-ii/) | [JavaScript](./src/search-in-rotated-sorted-array-ii/res.js) | Medium | -| 88 | [ Merge Sorted Array](https://leetcode.com/problems/merge-sorted-array/) | [JavaScript](./src/merge-sorted-array/res.js) | Medium | -| 91 | [Decode Ways](https://leetcode.com/problems/decode-ways/) | [JavaScript](./src/decode-ways/res.js) | Medium | -| 93 | [Restore IP Addresses](https://leetcode.com/problems/restore-ip-addresses/) | [JavaScript](./src/restore-ip-addresses/res.js) | Medium | -| 94 | [Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal/) | [TypeScript](./src/binary-tree-inorder-traversal/res.ts) | Easy | -| 95 | [unique-binary-search-trees-ii](https://leetcode.com/problems/unique-binary-search-trees-ii/) | [TypeScript](./src/unique-binary-search-trees-ii/res.ts) | Medium | -| 96 | [unique-binary-search-trees](https://leetcode.com/problems/unique-binary-search-trees/) | [TypeScript](./src/unique-binary-search-trees/res.ts) | Medium | -| 97 | [interleaving-string](https://leetcode.com/problems/interleaving-string/) | [TypeScript](./src/interleaving-string/res.ts) | Medium | -| 98 | [Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/) | [JavaScript](./src/validate-binary-search-tree/res.js) | Medium | -| 99 | [recover-binary-search-tree](https://leetcode.com/problems/recover-binary-search-tree/) | [TypeScript](./src/recover-binary-search-tree/res.ts) | Medium | -| 100 | [Same Tree](https://leetcode.com/problems/same-tree/) | [JavaScript](./src/same-tree/res.js) | Easy | -| 101 | [Symmetric Tree](https://leetcode.com/problems/symmetric-tree/) | [JavaScript](./src/symmetric-tree/res.js) | Easy | -| 102 | [Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/) | [JavaScript](./src/binary-tree-level-order-traversal/res.js) | Medium | -| 103 | [binary-tree-zigzag-level-order-traversal](https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/) | [TypeScript](./src/binary-tree-zigzag-level-order-traversal/res.ts) | Medium | -| 104 | [Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree/) | [JavaScript](./src/maximum-depth-of-binary-tree/res.js) | Easy | -| 107 | [Binary Tree Level Order Traversal II](https://leetcode.com/problems/binary-tree-level-order-traversal-ii/) | [JavaScript](./src/binary-tree-level-order-traversal-ii/res.js) | Easy | -| 108 | [Convert Sorted Array to Binary Search Tree](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/) | [JavaScript](./src/convert-sorted-array-to-binary-search-tree/res.js) | Easy | -| 110 | [balanced-binary-tree](https://leetcode.com/problems/balanced-binary-tree/) | [TypeScript](./src/balanced-binary-tree/res.ts) | Easy | -| 111 | [Minimum Depth of Binary Tree](https://leetcode.com/problems/minimum-depth-of-binary-tree/) | [JavaScript](./src/minimum-depth-of-binary-tree/res.js) · [TypeScript](./src/minimum-depth-of-binary-tree/res.ts) | Easy | -| 114 | [flatten-binary-tree-to-linked-list](https://leetcode.com/problems/flatten-binary-tree-to-linked-list/) | [TypeScript](./src/flatten-binary-tree-to-linked-list/res.ts) | Medium | -| 116 | [populating-next-right-pointers-in-each-node](https://leetcode.com/problems/populating-next-right-pointers-in-each-node/) | [TypeScript](./src/populating-next-right-pointers-in-each-node/res.ts) | Medium | -| 120 | [Triangle](https://leetcode.com/problems/triangle/) | [JavaScript](./src/triangle/res.js) | Medium | -| 121 | [Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) | [JavaScript](./src/best-time-to-buy-and-sell-stock/res.js) | Easy | -| 122 | [Best Time to Buy and Sell Stock II](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-ii/res.js) | Easy | -| 123 | [Best Time to Buy and Sell Stock III](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/) * | [JavaScript](./src/best-time-to-buy-and-sell-stock-iii/res.js) | Hard | -| 127 | [Word Ladder](https://leetcode.com/problems/word-ladder/) | [JavaScript](./src/word-ladder/res.js) | Medium | -| 128 | [Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence/) | [JavaScript](./src/longest-consecutive-sequence/res.js) | Medium | -| 129 | [sum-root-to-leaf-numbers](https://leetcode.com/problems/sum-root-to-leaf-numbers/) | [TypeScript](./src/sum-root-to-leaf-numbers/res.ts) | Medium | -| 130 | [Surrounded Regions](https://leetcode.com/problems/surrounded-regions/) | [JavaScript](./src/surrounded-regions/res.js) | Medium | -| 131 | [palindrome-partitioning](https://leetcode.com/problems/palindrome-partitioning/) | [TypeScript](./src/palindrome-partitioning/res.ts) | Medium | -| 133 | [Clone Graph](https://leetcode.com/problems/clone-graph/) | [JavaScript](./src/clone-graph/res.js) | Medium | -| 134 | [Gas Station](https://leetcode.com/problems/gas-station/) | [JavaScript](./src/gas-station/res.js) · [TypeScript](./src/gas-station/res.ts) | Medium | -| 135 | [Candy](https://leetcode.com/problems/candy/) | [JavaScript](./src/candy/res.js) | Hard | -| 136 | [Single Number](https://leetcode.com/problems/single-number/) | [JavaScript](./src/single-number/res.js) | Easy | -| 137 | [Single Number II](https://leetcode.com/problems/single-number-ii/) | [JavaScript](./src/single-number-ii/res.js) | Medium | -| 139 | [word-break](https://leetcode.com/problems/word-break/) | [TypeScript](./src/word-break/res.ts) | Medium | -| 143 | [reorder-list](https://leetcode.com/problems/reorder-list/) | [TypeScript](./src/reorder-list/res.ts) | Medium | -| 148 | [sort-list](https://leetcode.com/problems/sort-list/) | [TypeScript](./src/sort-list/res.ts) | Medium | -| 151 | [Reverse Words in a String](https://leetcode.com/problems/reverse-words-in-a-string/) | [JavaScript](./src/reverse-words-in-a-string/res.js) | Medium | -| 152 | [Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray/) | [JavaScript](./src/maximum-product-subarray/res.js) | Medium | -| 153 | [Find Minimum in Rotated Sorted Array](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/) | [JavaScript](./src/find-minimum-in-rotated-sorted-array/res.js) | Medium | -| 154 | [Find Minimum in Rotated Sorted Array II](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/) | [JavaScript](./src/find-minimum-in-rotated-sorted-array-ii/res.js) | Medium | -| 162 | [Find Peak Element](https://leetcode.com/problems/find-peak-element/) | [JavaScript](./src/find-peak-element/res.js) | Medium | -| 164 | [Maximum Gap](https://leetcode.com/problems/maximum-gap/) | [JavaScript](./src/maximum-gap/res.js) | Hard | -| 165 | [Compare Version Numbers](https://leetcode.com/problems/compare-version-numbers/) | [JavaScript](./src/compare-version-numbers/res.js) | Medium | -| 166 | [fraction-to-recurring-decimal](https://leetcode.com/problems/fraction-to-recurring-decimal/) | [TypeScript](./src/fraction-to-recurring-decimal/res.ts) | Medium | -| 169 | [Majority Element](https://leetcode.com/problems/majority-element/) | [JavaScript](./src/majority-element/res.js) | Easy | -| 175 | [Combine Two Tables](https://leetcode.com/problems/combine-two-tables/) | [SQL](./src/combine-two-tables/res.txt) | Easy | -| 176 | [Second Highest Salary](https://leetcode.com/problems/second-highest-salary/) | [SQL](./src/second-highest-salary/res.txt) | Easy | -| 177 | [Nth Highest Salary](https://leetcode.com/problems/nth-highest-salary/) | [SQL](./src/nth-highest-salary/res.txt) | Medium | -| 179 | [largest-number](https://leetcode.com/problems/largest-number/) | [TypeScript](./src/largest-number/res.ts) | Medium | -| 181 | [Employees Earning More Than Their Managers](https://leetcode.com/problems/employees-earning-more-than-their-managers/) | [SQL](./src/employees-earning-more-than-their-managers/res.txt) | Easy | -| 182 | [Duplicate Emails](https://leetcode.com/problems/duplicate-emails/) | [SQL](./src/duplicate-emails/res.txt) | Easy | -| 183 | [Customers Who Never Order](https://leetcode.com/problems/customers-who-never-order/) | [SQL](./src/customers-who-never-order/res.txt) | Easy | -| 184 | [Department Highest Salary](https://leetcode.com/problems/department-highest-salary/) | [SQL](./src/department-highest-salary/res.txt) | Medium | -| 188 | [Best Time to Buy and Sell Stock IV](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-iv/res.txt) | Hard | -| 189 | [Rotate Array](https://leetcode.com/problems/rotate-array/) | [JavaScript](./src/rotate-array/res.js) | Easy | -| 190 | [Reverse Bits](https://leetcode.com/problems/reverse-bits/) | [JavaScript](./src/reverse-bits/res.js) | Easy | -| 196 | [Delete Duplicate Emails](https://leetcode.com/problems/delete-duplicate-emails/) | [SQL](./src/delete-duplicate-emails/res.txt) | Easy | -| 197 | [Rising Temperature](https://leetcode.com/problems/rising-temperature/) | [SQL](./src/rising-temperature/res.txt) | Easy | -| 203 | [remove-linked-list-elements](https://leetcode.com/problems/remove-linked-list-elements/) | [TypeScript](./src/remove-linked-list-elements/res.ts) | Easy | -| 206 | [Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/) | [JavaScript](./src/reverse-linked-list/res.js) | Easy | -| 207 | [Course Schedule](https://leetcode.com/problems/course-schedule/) | [JavaScript](./src/course-schedule/res.js) | Medium | -| 209 | [Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum/) | [JavaScript](./src/minimum-size-subarray-sum/res.js) | Medium | -| 210 | [Course Schedule II](https://leetcode.com/problems/course-schedule-ii/) | [JavaScript](./src/course-schedule-ii/res.js) | Medium | -| 215 | [Kth Largest Element in an Array](https://leetcode.com/problems/kth-largest-element-in-an-array/) | [JavaScript](./src/kth-largest-element-in-an-array/res.js) | Medium | -| 217 | [Contains Duplicate](https://leetcode.com/problems/contains-duplicate/) | [JavaScript](./src/contains-duplicate/res.js) | Easy | -| 219 | [Contains Duplicate II](https://leetcode.com/problems/contains-duplicate-ii/) | [JavaScript](./src/contains-duplicate-ii/res.js) | Easy | -| 220 | [Contains Duplicate III](https://leetcode.com/problems/contains-duplicate-iii/) | [JavaScript](./src/contains-duplicate-iii/res.js) | Medium | -| 228 | [Summary Ranges](https://leetcode.com/problems/summary-ranges/solution/) | [JavaScript](./src/summary-ranges/res.js) | Medium | -| 230 | [kth-smallest-element-in-a-bst](https://leetcode.com/problems/kth-smallest-element-in-a-bst/solution/) | [TypeScript](./src/kth-smallest-element-in-a-bst/res.ts) | Medium | -| 238 | [Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/solution/) | [JavaScript](./src/product-of-array-except-self/res.js) | Medium | -| 239 | [Sliding Window Maximum](https://leetcode.com/problems/sliding-window-maximum/description/) | [JavaScript](./src/sliding-window-maximum/description/res.js) | Hard | -| 240 | [Search a 2D Matrix II](https://leetcode.com/problems/search-a-2d-matrix-ii/) | [JavaScript](./src/search-a-2d-matrix-ii/res.js) · [TypeScript](./src/search-a-2d-matrix-ii/res.ts) | Medium | -| 274 | [H-Index](https://leetcode.com/problems/h-index/) | [JavaScript](./src/h-index/res.js) | Medium | -| 275 | [H-Index II](https://leetcode.com/problems/h-index-ii/) | [JavaScript](./src/h-index-ii/res.js) | Medium | -| 278 | [First Bad Version](https://leetcode.com/problems/first-bad-version/) | [JavaScript](./src/first-bad-version/res.js) | Easy | -| 283 | [Move Zeroes](https://leetcode.com/problems/move-zeroes/) | [JavaScript](./src/move-zeroes/res.js) | Easy | -| 287 | [Find the Duplicate Number](https://leetcode.com/problems/find-the-duplicate-number/) | [JavaScript](./src/find-the-duplicate-number/res.js) | Medium | -| 289 | [Game of Life](https://leetcode.com/problems/game-of-life/) | [JavaScript](./src/game-of-life/res.js) | Medium | -| 295 | [Find Median from Data Stream](https://leetcode.com/problems/find-median-from-data-stream/) | [JavaScript](./src/find-median-from-data-stream/res.js) | Hard | -| 299 | [Bulls and Cows](https://leetcode.com/problems/bulls-and-cows/) | [JavaScript](./src/bulls-and-cows/res.js) | Medium | -| 300 | [Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence/) | [JavaScript](./src/longest-increasing-subsequence/res.js) | Medium | -| 307 | [Range Sum Query - Mutable](https://leetcode.com/problems/range-sum-query-mutable/) | [JavaScript](./src/range-sum-query-mutable/res.js) | Medium | -| 309 | [Best Time to Buy and Sell Stock with Cooldown](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-with-cooldown/res.js) | Medium | -| 310 | [Minimum Height Trees](https://leetcode.com/problems/minimum-height-trees/) | [JavaScript](./src/minimum-height-trees/res.js) | Medium | -| 315 | [Count of Smaller Numbers After Self](https://leetcode.com/problems/count-of-smaller-numbers-after-self/) * | [JavaScript](./src/count-of-smaller-numbers-after-self/res.js) | Hard | -| 316 | [remove-duplicate-letters](https://leetcode.com/problems/remove-duplicate-letters/) | [TypeScript](./src/remove-duplicate-letters/res.ts) | Medium | -| 322 | [Coin Change](https://leetcode.com/problems/coin-change/) | [JavaScript](./src/coin-change/res.js) | Medium | -| 327 | [Count of Range Sum](https://leetcode.com/problems/count-of-range-sum/) | [JavaScript](./src/count-of-range-sum/res.js) | Hard | -| 334 | [Increasing Triplet Subsequence](https://leetcode.com/problems/increasing-triplet-subsequence/) | [JavaScript](./src/increasing-triplet-subsequence/res.js) · [TypeScript](./src/increasing-triplet-subsequence/res.ts) | Medium | -| 340 | [Longest Substring with At Most K Distinct Characters](https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters/) | [JavaScript](./src/longest-substring-with-at-most-k-distinct-characters/res.js) | Hard | -| 342 | [Power of Four](https://leetcode.com/problems/power-of-four/) | [JavaScript](./src/power-of-four/res.js) | Easy | -| 344 | [Reverse String](https://leetcode.com/problems/reverse-string/) | [JavaScript](./src/reverse-string/res.js) | Easy | -| 349 | [Intersection of Two Arrays](https://leetcode.com/problems/intersection-of-two-arrays/) | [JavaScript](./src/intersection-of-two-arrays/res.js) | Easy | -| 350 | [Intersection of Two Arrays ii](https://leetcode.com/problems/intersection-of-two-arrays-ii/) | [JavaScript](./src/intersection-of-two-arrays-ii/res.js) | Easy | -| 371 | [Sum of Two Integers](https://leetcode.com/problems/sum-of-two-integers/) | [JavaScript](./src/sum-of-two-integers/res.js) | Easy | -| 374 | [Guess Number Higher or Lower](https://leetcode.com/problems/guess-number-higher-or-lower/) | [JavaScript](./src/guess-number-higher-or-lower/res.py) | Easy | -| 376 | [Wiggle Subsequence](https://leetcode.com/problems/wiggle-subsequence/) | [JavaScript](./src/wiggle-subsequence/res.js) · [TypeScript](./src/wiggle-subsequence/res.ts) | Medium | -| 384 | [Shuffle an Array](https://leetcode.com/problems/shuffle-an-array/) | [JavaScript](./src/shuffle-an-array/res.js) | Medium | -| 395 | [Longest Substring with At Least K Repeating Characters](https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters/) | [JavaScript](./src/longest-substring-with-at-least-k-repeating-characters/res.js) | Medium | -| 404 | [Sum of Left Leaves](https://leetcode.com/problems/sum-of-left-leaves/) | [JavaScript](./src/sum-of-left-leaves/res.js) | Easy | -| 406 | [queue-reconstruction-by-height](https://leetcode.com/problems/queue-reconstruction-by-height/) | [TypeScript](./src/queue-reconstruction-by-height/res.ts) | Medium | -| 413 | [Arithmetic Slices](https://leetcode.com/problems/arithmetic-slices/) | [JavaScript](./src/arithmetic-slices/res.js) | Medium | -| 416 | [Partition Equal Subset Sum](https://leetcode.com/problems/partition-equal-subset-sum/) | [JavaScript](./src/partition-equal-subset-sum/res.js) | Medium | -| 424 | [Longest Repeating Character Replacement](https://leetcode.com/problems/longest-repeating-character-replacement/) | [JavaScript](./src/longest-repeating-character-replacement/res.js) | Medium | -| 434 | [Number of Segments in a String](https://leetcode.com/problems/number-of-segments-in-a-string/) | [JavaScript](./src/number-of-segments-in-a-string/res.js) | Easy | -| 486 | [Predict the Winner](https://leetcode.com/problems/predict-the-winner/) | [JavaScript](./src/predict-the-winner/res.js) | Medium | -| 494 | [Target Sum](https://leetcode.com/problems/target-sum/) | [JavaScript](./src/target-sum/res.js) | Medium | -| 516 | [Longest Palindromic Subsequence](https://leetcode.com/problems/longest-palindromic-subsequence/) | [JavaScript](./src/longest-palindromic-subsequence/res.js) | Medium | -| 523 | [Continuous Subarray Sum](https://leetcode.com/problems/continuous-subarray-sum/) | [JavaScript](./src/continuous-subarray-sum/res.js) | Medium | -| 539 | [Minimum Time Difference](https://leetcode.com/problems/minimum-time-difference/) | [JavaScript](./src/minimum-time-difference/res.js) | Medium | -| 687 | [Longest Univalue Path](https://leetcode.com/problems/longest-univalue-path/) | [JavaScript](./src/longest-univalue-path/res.js) | Easy | -| 779 | [K-th Symbol in Grammar](https://leetcode.com/problems/k-th-symbol-in-grammar/) | [JavaScript](./src/k-th-symbol-in-grammar/res.js) | Medium | -| NO | [NAME](https://leetcode.com/problems/XXX/) | [TypeScript](./src/XXX/res.ts) | Easy | +| ID | Title | Solution | Difficulty | +|-----|-------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------| +| 1 | [Two Sum](https://leetcode.com/problems/two-sum/) | [JavaScript](./src/two-sum/res.js) | Easy | +| 2 | [Add Two Numbers](https://leetcode.com/problems/add-two-numbers/) | [JavaScript](./src/add-two-numbers/res.js) | Medium | +| 3 | [Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | [JavaScript](./src/longest-substring-without-repeating-characters/res.js) | Medium | +| 4 | [Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/) | [JavaScript](./src/median-of-two-sorted-arrays/res.js) | Hard | +| 5 | [Longest Palindromic Substring](https://leetcode.com/problems/longest-palindromic-substring/) | [JavaScript](./src/longest-palindromic-substring/res.js) | Medium | +| 6 | [ZigZag Conversion](https://leetcode.com/problems/zigzag-conversion/) | [JavaScript](./src/zigzag-conversion/res.js) | Medium | +| 7 | [Reverse Integer](https://leetcode.com/problems/reverse-integer/) | [JavaScript](./src/reverse-integer/res.js) | Easy | +| 8 | [String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi/) | [JavaScript](./src/string-to-integer-atoi/res.js) | Medium | +| 11 | [Container With Most Water](https://leetcode.com/problems/container-with-most-water/) | [JavaScript](./src/container-with-most-water/res.js) | Medium | +| 13 | [Roman to Integer](https://leetcode.com/problems/roman-to-integer/) | [JavaScript](./src/roman-to-integer/res.js) | Easy | +| 14 | [Longest Common Prefix](https://leetcode.com/problems/longest-common-prefix/) | [JavaScript](./src/longest-common-prefix/res.js) | Easy | +| 15 | [3Sum](https://leetcode.com/problems/3sum/) | [JavaScript](./src/3sum/res.js) | Medium | +| 16 | [3Sum Closest](https://leetcode.com/problems/3sum-closest/) | [JavaScript](./src/3sum-closest/res.js) | Medium | +| 17 | [Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/) | [JavaScript](./src/letter-combinations-of-a-phone-number/res.js) | Medium | +| 18 | [4sum](https://leetcode.com/problems/4sum/) | [TypeScript](./src/4sum/res.ts) | Medium | +| 19 | [Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) | [JavaScript](./src/remove-nth-node-from-end-of-list/res.js) | Medium | +| 20 | [valid-parentheses](https://leetcode.com/problems/valid-parentheses/) | [TypeScript](./src/valid-parentheses/res.ts) | Easy | +| 22 | [Generate Parentheses](https://leetcode.com/problems/generate-parentheses/) | [JavaScript](./src/generate-parentheses/res.js) | Medium | +| 24 | [swap-nodes-in-pairs](https://leetcode.com/problems/swap-nodes-in-pairs/) | [TypeScript](./src/swap-nodes-in-pairs/res.ts) | Medium | +| 26 | [Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/) | [JavaScript](./src/remove-duplicates-from-sorted-array/res.js) | Easy | +| 27 | [Remove Element](https://leetcode.com/problems/remove-element/) | [JavaScript](./src/remove-element/res.js) | Easy | +| 28 | [Implement strStr()](https://leetcode.com/problems/implement-strstr/) | [JavaScript](./src/implement-strstr/res.js) | Easy | +| 29 | [Divide Two Integers](https://leetcode.com/problems/divide-two-integers/) | [JavaScript](./src/divide-two-integers/res.js) | Medium | +| 31 | [next-permutation](https://leetcode.com/problems/next-permutation/) | [TypeScript](./src/next-permutation/res.ts) | Medium | +| 33 | [Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/) | [JavaScript](./src/search-in-rotated-sorted-array/res.js) | Medium | +| 34 | [Search for a Range](https://leetcode.com/problems/search-for-a-range/) | [JavaScript](./src/search-for-a-range/res.js) | Medium | +| 35 | [Search Insert Position](https://leetcode.com/problems/search-insert-position/) | [JavaScript](./src/search-insert-position/res.js) | Easy | +| 38 | [count-and-say](https://leetcode.com/problems/count-and-say/) | [TypeScript](./src/count-and-say/res.ts) | Medium | +| 39 | [Combination Sum](https://leetcode.com/problems/combination-sum/) | [JavaScript](./src/combination-sum/res.js) | Medium | +| 40 | [Combination Sum II](https://leetcode.com/problems/combination-sum-ii/) | [JavaScript](./src/combination-sum-ii/res.js) | Medium | +| 41 | [First Missing Positive](https://leetcode.com/problems/first-missing-positive/description/) | [JavaScript](./src/first-missing-positive/res.js) | Hard | +| 42 | [ Trapping Rain Water](https://leetcode.com/problems/trapping-rain-water/description/) | [JavaScript](./src/trapping-rain-water/res.js) | Hard | +| 43 | [Multiply Strings](https://leetcode.com/problems/multiply-strings/) | [JavaScript](./src/multiply-strings/res.js) | Medium | +| 45 | [Jump Game II](https://leetcode.com/problems/jump-game-ii/) | [JavaScript](./src/jump-game-ii/res.js) | Hard | +| 46 | [Permutations](https://leetcode.com/problems/permutations/) | [JavaScript](./src/permutations/res.js) | Medium | +| 47 | [permutations-ii](https://leetcode.com/problems/permutations-ii/) | [TypeScript](./src/permutations-ii/res.ts) | Medium | +| 48 | [Rotate Image](https://leetcode.com/problems/rotate-image/) | [JavaScript](./src/rotate-image/res.js) | Medium | +| 49 | [Group Anagrams](https://leetcode.com/problems/anagrams/) | [JavaScript](./src/anagrams/res.js) | Medium | +| 50 | [powx-n](https://leetcode.com/problems/powx-n/) | [TypeScript](./src/powx-n/res.ts) | Medium | +| 53 | [Maximum Subarray](https://leetcode.com/problems/maximum-subarray/) | [JavaScript](./src/maximum-subarray/res.js) · [TypeScript](./src/maximum-subarray/res.ts) | Easy | +| 54 | [Spiral Matrix](https://leetcode.com/problems/spiral-matrix/) | [JavaScript](./src/spiral-matrix/res.js) | Medium | +| 55 | [Jump Game](https://leetcode.com/problems/jump-game/) * | [JavaScript](./src/jump-game/res.js) | Medium | +| 56 | [Merge Intervals](https://leetcode.com/problems/merge-intervals/) | [JavaScript](./src/merge-intervals/res.js) | Medium | +| 57 | [Insert Interval](https://leetcode.com/problems/insert-interval/) | [JavaScript](./src/insert-interval/res.js) | Hard | +| 62 | [Unique Paths](https://leetcode.com/problems/unique-paths/) | [JavaScript](./src/unique-paths/res.js) | Medium | +| 63 | [Unique Paths ii](https://leetcode.com/problems/unique-paths-ii/) | [JavaScript](./src/unique-paths-ii/res.js) | Medium | +| 64 | [minimum-path-sum](https://leetcode.com/problems/minimum-path-sum/) | [TypeScript](./src/minimum-path-sum/res.ts) | Medium | +| 66 | [Plus One](https://leetcode.com/problems/plus-one/) | [JavaScript](./src/plus-one/res.js) | Easy | +| 69 | [Sqrt(x)](https://leetcode.com/problems/sqrtx/) | [JavaScript](./src/sqrtx/res.js) | Easy | +| 70 | [climbing-stairs](https://leetcode.com/problems/climbing-stairs/) | [TypeScript](./src/climbing-stairs/res.ts) | Easy | +| 71 | [Simplify Path](https://leetcode.com/problems/simplify-path/) | [JavaScript](./src/simplify-path/res.js) | Medium | +| 73 | [Set Matrix Zeroes](https://leetcode.com/problems/set-matrix-zeroes/) | [JavaScript](./src/set-matrix-zeroes/res.js) | Medium | +| 75 | [Sort Colors](https://leetcode.com/problems/sort-colors/) | [JavaScript](./src/sort-colors/res.js) | Medium | +| 77 | [combinations](https://leetcode.com/problems/combinations/) | [TypeScript](./src/combinations/res.ts) | Medium | +| 80 | [Remove Duplicates from Sorted Array II](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/) | [JavaScript](./src/remove-duplicates-from-sorted-array-ii/res.js) | Medium | +| 81 | [Search in Rotated Sorted Array II](https://leetcode.com/problems/search-in-rotated-sorted-array-ii/) | [JavaScript](./src/search-in-rotated-sorted-array-ii/res.js) | Medium | +| 88 | [ Merge Sorted Array](https://leetcode.com/problems/merge-sorted-array/) | [JavaScript](./src/merge-sorted-array/res.js) | Medium | +| 91 | [Decode Ways](https://leetcode.com/problems/decode-ways/) | [JavaScript](./src/decode-ways/res.js) | Medium | +| 93 | [Restore IP Addresses](https://leetcode.com/problems/restore-ip-addresses/) | [JavaScript](./src/restore-ip-addresses/res.js) | Medium | +| 94 | [Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal/) | [TypeScript](./src/binary-tree-inorder-traversal/res.ts) | Easy | +| 95 | [unique-binary-search-trees-ii](https://leetcode.com/problems/unique-binary-search-trees-ii/) | [TypeScript](./src/unique-binary-search-trees-ii/res.ts) | Medium | +| 96 | [unique-binary-search-trees](https://leetcode.com/problems/unique-binary-search-trees/) | [TypeScript](./src/unique-binary-search-trees/res.ts) | Medium | +| 97 | [interleaving-string](https://leetcode.com/problems/interleaving-string/) | [TypeScript](./src/interleaving-string/res.ts) | Medium | +| 98 | [Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/) | [JavaScript](./src/validate-binary-search-tree/res.js) | Medium | +| 99 | [recover-binary-search-tree](https://leetcode.com/problems/recover-binary-search-tree/) | [TypeScript](./src/recover-binary-search-tree/res.ts) | Medium | +| 100 | [Same Tree](https://leetcode.com/problems/same-tree/) | [JavaScript](./src/same-tree/res.js) | Easy | +| 101 | [Symmetric Tree](https://leetcode.com/problems/symmetric-tree/) | [JavaScript](./src/symmetric-tree/res.js) | Easy | +| 102 | [Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/) | [JavaScript](./src/binary-tree-level-order-traversal/res.js) | Medium | +| 103 | [binary-tree-zigzag-level-order-traversal](https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/) | [TypeScript](./src/binary-tree-zigzag-level-order-traversal/res.ts) | Medium | +| 104 | [Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree/) | [JavaScript](./src/maximum-depth-of-binary-tree/res.js) | Easy | +| 107 | [Binary Tree Level Order Traversal II](https://leetcode.com/problems/binary-tree-level-order-traversal-ii/) | [JavaScript](./src/binary-tree-level-order-traversal-ii/res.js) | Easy | +| 108 | [Convert Sorted Array to Binary Search Tree](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/) | [JavaScript](./src/convert-sorted-array-to-binary-search-tree/res.js) | Easy | +| 110 | [balanced-binary-tree](https://leetcode.com/problems/balanced-binary-tree/) | [TypeScript](./src/balanced-binary-tree/res.ts) | Easy | +| 111 | [Minimum Depth of Binary Tree](https://leetcode.com/problems/minimum-depth-of-binary-tree/) | [JavaScript](./src/minimum-depth-of-binary-tree/res.js) · [TypeScript](./src/minimum-depth-of-binary-tree/res.ts) | Easy | +| 114 | [flatten-binary-tree-to-linked-list](https://leetcode.com/problems/flatten-binary-tree-to-linked-list/) | [TypeScript](./src/flatten-binary-tree-to-linked-list/res.ts) | Medium | +| 116 | [populating-next-right-pointers-in-each-node](https://leetcode.com/problems/populating-next-right-pointers-in-each-node/) | [TypeScript](./src/populating-next-right-pointers-in-each-node/res.ts) | Medium | +| 120 | [Triangle](https://leetcode.com/problems/triangle/) | [JavaScript](./src/triangle/res.js) | Medium | +| 121 | [Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) | [JavaScript](./src/best-time-to-buy-and-sell-stock/res.js) · [TypeScript](./src/best-time-to-buy-and-sell-stock/res.ts) | Easy | +| 122 | [Best Time to Buy and Sell Stock II](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-ii/res.js) | Easy | +| 123 | [Best Time to Buy and Sell Stock III](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/) * | [JavaScript](./src/best-time-to-buy-and-sell-stock-iii/res.js) | Hard | +| 127 | [Word Ladder](https://leetcode.com/problems/word-ladder/) | [JavaScript](./src/word-ladder/res.js) | Medium | +| 128 | [Longest Consecutive Sequence](https://leetcode.com/problems/longest-consecutive-sequence/) | [JavaScript](./src/longest-consecutive-sequence/res.js) | Medium | +| 129 | [sum-root-to-leaf-numbers](https://leetcode.com/problems/sum-root-to-leaf-numbers/) | [TypeScript](./src/sum-root-to-leaf-numbers/res.ts) | Medium | +| 130 | [Surrounded Regions](https://leetcode.com/problems/surrounded-regions/) | [JavaScript](./src/surrounded-regions/res.js) | Medium | +| 131 | [palindrome-partitioning](https://leetcode.com/problems/palindrome-partitioning/) | [TypeScript](./src/palindrome-partitioning/res.ts) | Medium | +| 133 | [Clone Graph](https://leetcode.com/problems/clone-graph/) | [JavaScript](./src/clone-graph/res.js) | Medium | +| 134 | [Gas Station](https://leetcode.com/problems/gas-station/) | [JavaScript](./src/gas-station/res.js) · [TypeScript](./src/gas-station/res.ts) | Medium | +| 135 | [Candy](https://leetcode.com/problems/candy/) | [JavaScript](./src/candy/res.js) | Hard | +| 136 | [Single Number](https://leetcode.com/problems/single-number/) | [JavaScript](./src/single-number/res.js) | Easy | +| 137 | [Single Number II](https://leetcode.com/problems/single-number-ii/) | [JavaScript](./src/single-number-ii/res.js) | Medium | +| 139 | [word-break](https://leetcode.com/problems/word-break/) | [TypeScript](./src/word-break/res.ts) | Medium | +| 143 | [reorder-list](https://leetcode.com/problems/reorder-list/) | [TypeScript](./src/reorder-list/res.ts) | Medium | +| 148 | [sort-list](https://leetcode.com/problems/sort-list/) | [TypeScript](./src/sort-list/res.ts) | Medium | +| 151 | [Reverse Words in a String](https://leetcode.com/problems/reverse-words-in-a-string/) | [JavaScript](./src/reverse-words-in-a-string/res.js) | Medium | +| 152 | [Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray/) | [JavaScript](./src/maximum-product-subarray/res.js) | Medium | +| 153 | [Find Minimum in Rotated Sorted Array](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/) | [JavaScript](./src/find-minimum-in-rotated-sorted-array/res.js) | Medium | +| 154 | [Find Minimum in Rotated Sorted Array II](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array-ii/) | [JavaScript](./src/find-minimum-in-rotated-sorted-array-ii/res.js) | Medium | +| 162 | [Find Peak Element](https://leetcode.com/problems/find-peak-element/) | [JavaScript](./src/find-peak-element/res.js) | Medium | +| 164 | [Maximum Gap](https://leetcode.com/problems/maximum-gap/) | [JavaScript](./src/maximum-gap/res.js) | Hard | +| 165 | [Compare Version Numbers](https://leetcode.com/problems/compare-version-numbers/) | [JavaScript](./src/compare-version-numbers/res.js) | Medium | +| 166 | [fraction-to-recurring-decimal](https://leetcode.com/problems/fraction-to-recurring-decimal/) | [TypeScript](./src/fraction-to-recurring-decimal/res.ts) | Medium | +| 169 | [Majority Element](https://leetcode.com/problems/majority-element/) | [JavaScript](./src/majority-element/res.js) | Easy | +| 175 | [Combine Two Tables](https://leetcode.com/problems/combine-two-tables/) | [SQL](./src/combine-two-tables/res.txt) | Easy | +| 176 | [Second Highest Salary](https://leetcode.com/problems/second-highest-salary/) | [SQL](./src/second-highest-salary/res.txt) | Easy | +| 177 | [Nth Highest Salary](https://leetcode.com/problems/nth-highest-salary/) | [SQL](./src/nth-highest-salary/res.txt) | Medium | +| 179 | [largest-number](https://leetcode.com/problems/largest-number/) | [TypeScript](./src/largest-number/res.ts) | Medium | +| 181 | [Employees Earning More Than Their Managers](https://leetcode.com/problems/employees-earning-more-than-their-managers/) | [SQL](./src/employees-earning-more-than-their-managers/res.txt) | Easy | +| 182 | [Duplicate Emails](https://leetcode.com/problems/duplicate-emails/) | [SQL](./src/duplicate-emails/res.txt) | Easy | +| 183 | [Customers Who Never Order](https://leetcode.com/problems/customers-who-never-order/) | [SQL](./src/customers-who-never-order/res.txt) | Easy | +| 184 | [Department Highest Salary](https://leetcode.com/problems/department-highest-salary/) | [SQL](./src/department-highest-salary/res.txt) | Medium | +| 188 | [Best Time to Buy and Sell Stock IV](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iv/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-iv/res.txt) | Hard | +| 189 | [Rotate Array](https://leetcode.com/problems/rotate-array/) | [JavaScript](./src/rotate-array/res.js) | Easy | +| 190 | [Reverse Bits](https://leetcode.com/problems/reverse-bits/) | [JavaScript](./src/reverse-bits/res.js) | Easy | +| 196 | [Delete Duplicate Emails](https://leetcode.com/problems/delete-duplicate-emails/) | [SQL](./src/delete-duplicate-emails/res.txt) | Easy | +| 197 | [Rising Temperature](https://leetcode.com/problems/rising-temperature/) | [SQL](./src/rising-temperature/res.txt) | Easy | +| 203 | [remove-linked-list-elements](https://leetcode.com/problems/remove-linked-list-elements/) | [TypeScript](./src/remove-linked-list-elements/res.ts) | Easy | +| 206 | [Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/) | [JavaScript](./src/reverse-linked-list/res.js) | Easy | +| 207 | [Course Schedule](https://leetcode.com/problems/course-schedule/) | [JavaScript](./src/course-schedule/res.js) | Medium | +| 209 | [Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum/) | [JavaScript](./src/minimum-size-subarray-sum/res.js) | Medium | +| 210 | [Course Schedule II](https://leetcode.com/problems/course-schedule-ii/) | [JavaScript](./src/course-schedule-ii/res.js) | Medium | +| 215 | [Kth Largest Element in an Array](https://leetcode.com/problems/kth-largest-element-in-an-array/) | [JavaScript](./src/kth-largest-element-in-an-array/res.js) | Medium | +| 217 | [Contains Duplicate](https://leetcode.com/problems/contains-duplicate/) | [JavaScript](./src/contains-duplicate/res.js) | Easy | +| 219 | [Contains Duplicate II](https://leetcode.com/problems/contains-duplicate-ii/) | [JavaScript](./src/contains-duplicate-ii/res.js) | Easy | +| 220 | [Contains Duplicate III](https://leetcode.com/problems/contains-duplicate-iii/) | [JavaScript](./src/contains-duplicate-iii/res.js) | Medium | +| 228 | [Summary Ranges](https://leetcode.com/problems/summary-ranges/solution/) | [JavaScript](./src/summary-ranges/res.js) | Medium | +| 230 | [kth-smallest-element-in-a-bst](https://leetcode.com/problems/kth-smallest-element-in-a-bst/solution/) | [TypeScript](./src/kth-smallest-element-in-a-bst/res.ts) | Medium | +| 238 | [Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/solution/) | [JavaScript](./src/product-of-array-except-self/res.js) | Medium | +| 239 | [Sliding Window Maximum](https://leetcode.com/problems/sliding-window-maximum/description/) | [JavaScript](./src/sliding-window-maximum/description/res.js) | Hard | +| 240 | [Search a 2D Matrix II](https://leetcode.com/problems/search-a-2d-matrix-ii/) | [JavaScript](./src/search-a-2d-matrix-ii/res.js) · [TypeScript](./src/search-a-2d-matrix-ii/res.ts) | Medium | +| 274 | [H-Index](https://leetcode.com/problems/h-index/) | [JavaScript](./src/h-index/res.js) | Medium | +| 275 | [H-Index II](https://leetcode.com/problems/h-index-ii/) | [JavaScript](./src/h-index-ii/res.js) | Medium | +| 278 | [First Bad Version](https://leetcode.com/problems/first-bad-version/) | [JavaScript](./src/first-bad-version/res.js) | Easy | +| 283 | [Move Zeroes](https://leetcode.com/problems/move-zeroes/) | [JavaScript](./src/move-zeroes/res.js) | Easy | +| 287 | [Find the Duplicate Number](https://leetcode.com/problems/find-the-duplicate-number/) | [JavaScript](./src/find-the-duplicate-number/res.js) | Medium | +| 289 | [Game of Life](https://leetcode.com/problems/game-of-life/) | [JavaScript](./src/game-of-life/res.js) | Medium | +| 295 | [Find Median from Data Stream](https://leetcode.com/problems/find-median-from-data-stream/) | [JavaScript](./src/find-median-from-data-stream/res.js) | Hard | +| 299 | [Bulls and Cows](https://leetcode.com/problems/bulls-and-cows/) | [JavaScript](./src/bulls-and-cows/res.js) | Medium | +| 300 | [Longest Increasing Subsequence](https://leetcode.com/problems/longest-increasing-subsequence/) | [JavaScript](./src/longest-increasing-subsequence/res.js) | Medium | +| 307 | [Range Sum Query - Mutable](https://leetcode.com/problems/range-sum-query-mutable/) | [JavaScript](./src/range-sum-query-mutable/res.js) | Medium | +| 309 | [Best Time to Buy and Sell Stock with Cooldown](https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-cooldown/) | [JavaScript](./src/best-time-to-buy-and-sell-stock-with-cooldown/res.js) | Medium | +| 310 | [Minimum Height Trees](https://leetcode.com/problems/minimum-height-trees/) | [JavaScript](./src/minimum-height-trees/res.js) | Medium | +| 315 | [Count of Smaller Numbers After Self](https://leetcode.com/problems/count-of-smaller-numbers-after-self/) * | [JavaScript](./src/count-of-smaller-numbers-after-self/res.js) | Hard | +| 316 | [remove-duplicate-letters](https://leetcode.com/problems/remove-duplicate-letters/) | [TypeScript](./src/remove-duplicate-letters/res.ts) | Medium | +| 322 | [Coin Change](https://leetcode.com/problems/coin-change/) | [JavaScript](./src/coin-change/res.js) | Medium | +| 327 | [Count of Range Sum](https://leetcode.com/problems/count-of-range-sum/) | [JavaScript](./src/count-of-range-sum/res.js) | Hard | +| 334 | [Increasing Triplet Subsequence](https://leetcode.com/problems/increasing-triplet-subsequence/) | [JavaScript](./src/increasing-triplet-subsequence/res.js) · [TypeScript](./src/increasing-triplet-subsequence/res.ts) | Medium | +| 340 | [Longest Substring with At Most K Distinct Characters](https://leetcode.com/problems/longest-substring-with-at-most-k-distinct-characters/) | [JavaScript](./src/longest-substring-with-at-most-k-distinct-characters/res.js) | Hard | +| 342 | [Power of Four](https://leetcode.com/problems/power-of-four/) | [JavaScript](./src/power-of-four/res.js) | Easy | +| 344 | [Reverse String](https://leetcode.com/problems/reverse-string/) | [JavaScript](./src/reverse-string/res.js) | Easy | +| 349 | [Intersection of Two Arrays](https://leetcode.com/problems/intersection-of-two-arrays/) | [JavaScript](./src/intersection-of-two-arrays/res.js) | Easy | +| 350 | [Intersection of Two Arrays ii](https://leetcode.com/problems/intersection-of-two-arrays-ii/) | [JavaScript](./src/intersection-of-two-arrays-ii/res.js) | Easy | +| 371 | [Sum of Two Integers](https://leetcode.com/problems/sum-of-two-integers/) | [JavaScript](./src/sum-of-two-integers/res.js) | Easy | +| 374 | [Guess Number Higher or Lower](https://leetcode.com/problems/guess-number-higher-or-lower/) | [JavaScript](./src/guess-number-higher-or-lower/res.py) | Easy | +| 376 | [Wiggle Subsequence](https://leetcode.com/problems/wiggle-subsequence/) | [JavaScript](./src/wiggle-subsequence/res.js) · [TypeScript](./src/wiggle-subsequence/res.ts) | Medium | +| 384 | [Shuffle an Array](https://leetcode.com/problems/shuffle-an-array/) | [JavaScript](./src/shuffle-an-array/res.js) | Medium | +| 395 | [Longest Substring with At Least K Repeating Characters](https://leetcode.com/problems/longest-substring-with-at-least-k-repeating-characters/) | [JavaScript](./src/longest-substring-with-at-least-k-repeating-characters/res.js) | Medium | +| 404 | [Sum of Left Leaves](https://leetcode.com/problems/sum-of-left-leaves/) | [JavaScript](./src/sum-of-left-leaves/res.js) | Easy | +| 406 | [queue-reconstruction-by-height](https://leetcode.com/problems/queue-reconstruction-by-height/) | [TypeScript](./src/queue-reconstruction-by-height/res.ts) | Medium | +| 413 | [Arithmetic Slices](https://leetcode.com/problems/arithmetic-slices/) | [JavaScript](./src/arithmetic-slices/res.js) | Medium | +| 416 | [Partition Equal Subset Sum](https://leetcode.com/problems/partition-equal-subset-sum/) | [JavaScript](./src/partition-equal-subset-sum/res.js) | Medium | +| 424 | [Longest Repeating Character Replacement](https://leetcode.com/problems/longest-repeating-character-replacement/) | [JavaScript](./src/longest-repeating-character-replacement/res.js) | Medium | +| 434 | [Number of Segments in a String](https://leetcode.com/problems/number-of-segments-in-a-string/) | [JavaScript](./src/number-of-segments-in-a-string/res.js) | Easy | +| 486 | [Predict the Winner](https://leetcode.com/problems/predict-the-winner/) | [JavaScript](./src/predict-the-winner/res.js) | Medium | +| 494 | [Target Sum](https://leetcode.com/problems/target-sum/) | [JavaScript](./src/target-sum/res.js) | Medium | +| 516 | [Longest Palindromic Subsequence](https://leetcode.com/problems/longest-palindromic-subsequence/) | [JavaScript](./src/longest-palindromic-subsequence/res.js) | Medium | +| 523 | [Continuous Subarray Sum](https://leetcode.com/problems/continuous-subarray-sum/) | [JavaScript](./src/continuous-subarray-sum/res.js) | Medium | +| 539 | [Minimum Time Difference](https://leetcode.com/problems/minimum-time-difference/) | [JavaScript](./src/minimum-time-difference/res.js) | Medium | +| 687 | [Longest Univalue Path](https://leetcode.com/problems/longest-univalue-path/) | [JavaScript](./src/longest-univalue-path/res.js) | Easy | +| 779 | [K-th Symbol in Grammar](https://leetcode.com/problems/k-th-symbol-in-grammar/) | [JavaScript](./src/k-th-symbol-in-grammar/res.js) | Medium | +| NO | [NAME](https://leetcode.com/problems/XXX/) | [TypeScript](./src/XXX/res.ts) | Easy | diff --git a/src/best-time-to-buy-and-sell-stock/res.ts b/src/best-time-to-buy-and-sell-stock/res.ts new file mode 100644 index 0000000..08ffd31 --- /dev/null +++ b/src/best-time-to-buy-and-sell-stock/res.ts @@ -0,0 +1,43 @@ +function maxProfit(prices: number[]): number { + const minList = new Array(prices.length).fill(Number.MAX_SAFE_INTEGER); + const maxList = new Array(prices.length).fill(Number.MIN_SAFE_INTEGER); + + let currentMin = Number.MAX_SAFE_INTEGER; + for (let i = 0; i < prices.length; i++) { + if (currentMin > prices[i]) { + currentMin = prices[i]; + } + minList[i] = currentMin; + } + + let currentMax = Number.MIN_SAFE_INTEGER; + for (let i = prices.length - 1; i >= 0; i--) { + if (currentMax < prices[i]) { + currentMax = prices[i]; + } + maxList[i] = currentMax; + } + + let maxProfit = 0; + for (let i = 0; i < prices.length; i++) { + maxProfit = Math.max(maxProfit, maxList[i] - minList[i]); + } + + return maxProfit; +}; + +function maxProfit2(prices: number[]): number { + const minList = new Array(prices.length).fill(Number.MAX_SAFE_INTEGER); + + let maxProfit = 0; + let currentMin = Number.MAX_SAFE_INTEGER; + for (let i = 0; i < prices.length; i++) { + if (currentMin > prices[i]) { + currentMin = prices[i]; + } + minList[i] = currentMin; + maxProfit = Math.max(maxProfit, prices[i] - minList[i]); + } + + return maxProfit; +}; \ No newline at end of file From 14bf119bc8393f997ad9b7d85ebb21088a3156ed Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Mon, 4 Jul 2022 20:15:49 +0800 Subject: [PATCH 46/53] update: 198 --- README.md | 1 + src/house-robber/res.ts | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 src/house-robber/res.ts diff --git a/README.md b/README.md index cf067d5..7b154a0 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 190 | [Reverse Bits](https://leetcode.com/problems/reverse-bits/) | [JavaScript](./src/reverse-bits/res.js) | Easy | | 196 | [Delete Duplicate Emails](https://leetcode.com/problems/delete-duplicate-emails/) | [SQL](./src/delete-duplicate-emails/res.txt) | Easy | | 197 | [Rising Temperature](https://leetcode.com/problems/rising-temperature/) | [SQL](./src/rising-temperature/res.txt) | Easy | +| 198 | [house-robber](https://leetcode.com/problems/house-robber/) | [TypeScript](./src/house-robber/res.ts) | Medium | | 203 | [remove-linked-list-elements](https://leetcode.com/problems/remove-linked-list-elements/) | [TypeScript](./src/remove-linked-list-elements/res.ts) | Easy | | 206 | [Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/) | [JavaScript](./src/reverse-linked-list/res.js) | Easy | | 207 | [Course Schedule](https://leetcode.com/problems/course-schedule/) | [JavaScript](./src/course-schedule/res.js) | Medium | diff --git a/src/house-robber/res.ts b/src/house-robber/res.ts new file mode 100644 index 0000000..319a7a1 --- /dev/null +++ b/src/house-robber/res.ts @@ -0,0 +1,19 @@ +function rob(nums: number[]): number { + if (!nums.length) { + return 0; + } + + const dp: number[] = new Array(nums.length).fill(0); + + for (let i = 0; i < nums.length; i++) { + if (i === 0) { + dp[i] = nums[i]; + } else if (i === 1) { + dp[i] = Math.max(nums[i], dp[i-1]); + } else { + dp[i] = Math.max(nums[i] + dp[i-2], dp[i-1]); + } + } + + return dp[nums.length-1]; +}; \ No newline at end of file From 5948bce97175b038e143e70426fd0662052946be Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Mon, 4 Jul 2022 20:23:46 +0800 Subject: [PATCH 47/53] update: 213 --- README.md | 1 + src/house-robber-ii/res.ts | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 src/house-robber-ii/res.ts diff --git a/README.md b/README.md index 7b154a0..c8f791e 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 207 | [Course Schedule](https://leetcode.com/problems/course-schedule/) | [JavaScript](./src/course-schedule/res.js) | Medium | | 209 | [Minimum Size Subarray Sum](https://leetcode.com/problems/minimum-size-subarray-sum/) | [JavaScript](./src/minimum-size-subarray-sum/res.js) | Medium | | 210 | [Course Schedule II](https://leetcode.com/problems/course-schedule-ii/) | [JavaScript](./src/course-schedule-ii/res.js) | Medium | +| 213 | [house-robber-ii](https://leetcode.com/problems/house-robber-ii/) | [TypeScript](./src/house-robber-ii/res.ts) | Medium | | 215 | [Kth Largest Element in an Array](https://leetcode.com/problems/kth-largest-element-in-an-array/) | [JavaScript](./src/kth-largest-element-in-an-array/res.js) | Medium | | 217 | [Contains Duplicate](https://leetcode.com/problems/contains-duplicate/) | [JavaScript](./src/contains-duplicate/res.js) | Easy | | 219 | [Contains Duplicate II](https://leetcode.com/problems/contains-duplicate-ii/) | [JavaScript](./src/contains-duplicate-ii/res.js) | Easy | diff --git a/src/house-robber-ii/res.ts b/src/house-robber-ii/res.ts new file mode 100644 index 0000000..0314815 --- /dev/null +++ b/src/house-robber-ii/res.ts @@ -0,0 +1,27 @@ +function internalRob(nums: number[]): number { + if (!nums.length) { + return 0; + } + + const dp: number[] = new Array(nums.length).fill(0); + + for (let i = 0; i < nums.length; i++) { + if (i === 0) { + dp[i] = nums[i]; + } else if (i === 1) { + dp[i] = Math.max(nums[i], dp[i-1]); + } else { + dp[i] = Math.max(nums[i] + dp[i-2], dp[i-1]); + } + } + + return dp[nums.length-1]; +}; + +function rob(nums: number[]): number { + if (!nums.length) { + return 0; + } + + return Math.max(internalRob(nums.slice(1)), internalRob(nums.slice(2, nums.length-1)) + nums[0]); +}; \ No newline at end of file From b485a05f58776677a5a594610b9cd7c9de17e2ac Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Mon, 4 Jul 2022 20:25:34 +0800 Subject: [PATCH 48/53] update: README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c8f791e..1c59878 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr **ATTENTION**: If you also use JavaScript as your coding language, you should pay attention to some JavaScript INTERNAL issues, such as bitwise operators, so as to let you not drop into some trouble which may be caused by JavaScript itself. -**Progress: 156/2520 Solutions** +**Progress: 171/2520 Solutions** | ID | Title | Solution | Difficulty | |-----|-------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------| From 38a3c483db66a5f08daa0c7bf35fec31fa73fffa Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Tue, 5 Jul 2022 11:07:04 +0800 Subject: [PATCH 49/53] update: 147 --- README.md | 3 ++- src/insertion-sort-list/res.ts | 44 ++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 src/insertion-sort-list/res.ts diff --git a/README.md b/README.md index 1c59878..259c39c 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 77 | [combinations](https://leetcode.com/problems/combinations/) | [TypeScript](./src/combinations/res.ts) | Medium | | 80 | [Remove Duplicates from Sorted Array II](https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/) | [JavaScript](./src/remove-duplicates-from-sorted-array-ii/res.js) | Medium | | 81 | [Search in Rotated Sorted Array II](https://leetcode.com/problems/search-in-rotated-sorted-array-ii/) | [JavaScript](./src/search-in-rotated-sorted-array-ii/res.js) | Medium | -| 88 | [ Merge Sorted Array](https://leetcode.com/problems/merge-sorted-array/) | [JavaScript](./src/merge-sorted-array/res.js) | Medium | +| 88 | [Merge Sorted Array](https://leetcode.com/problems/merge-sorted-array/) | [JavaScript](./src/merge-sorted-array/res.js) | Medium | | 91 | [Decode Ways](https://leetcode.com/problems/decode-ways/) | [JavaScript](./src/decode-ways/res.js) | Medium | | 93 | [Restore IP Addresses](https://leetcode.com/problems/restore-ip-addresses/) | [JavaScript](./src/restore-ip-addresses/res.js) | Medium | | 94 | [Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal/) | [TypeScript](./src/binary-tree-inorder-traversal/res.ts) | Easy | @@ -100,6 +100,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 137 | [Single Number II](https://leetcode.com/problems/single-number-ii/) | [JavaScript](./src/single-number-ii/res.js) | Medium | | 139 | [word-break](https://leetcode.com/problems/word-break/) | [TypeScript](./src/word-break/res.ts) | Medium | | 143 | [reorder-list](https://leetcode.com/problems/reorder-list/) | [TypeScript](./src/reorder-list/res.ts) | Medium | +| 147 | [insertion-sort-list](https://leetcode.com/problems/insertion-sort-list/) | [TypeScript](./src/insertion-sort-list/res.ts) | Medium | | 148 | [sort-list](https://leetcode.com/problems/sort-list/) | [TypeScript](./src/sort-list/res.ts) | Medium | | 151 | [Reverse Words in a String](https://leetcode.com/problems/reverse-words-in-a-string/) | [JavaScript](./src/reverse-words-in-a-string/res.js) | Medium | | 152 | [Maximum Product Subarray](https://leetcode.com/problems/maximum-product-subarray/) | [JavaScript](./src/maximum-product-subarray/res.js) | Medium | diff --git a/src/insertion-sort-list/res.ts b/src/insertion-sort-list/res.ts new file mode 100644 index 0000000..d5c50a8 --- /dev/null +++ b/src/insertion-sort-list/res.ts @@ -0,0 +1,44 @@ +/** + * Definition for singly-linked list. + * class ListNode { + * val: number + * next: ListNode | null + * constructor(val?: number, next?: ListNode | null) { + * this.val = (val===undefined ? 0 : val) + * this.next = (next===undefined ? null : next) + * } + * } + */ + +function insertionSortList(head: ListNode | null): ListNode | null { + if (!head) { + return null; + } + + const dumpyHead = new ListNode(0); + let lastSortedNode = head; + dumpyHead.next = head; + + while (lastSortedNode?.next) { + const nextNode = lastSortedNode.next; + if (nextNode.val >= lastSortedNode.val) { + lastSortedNode = nextNode; + } else { + let currentIterateNode = dumpyHead; + while (currentIterateNode.next && currentIterateNode.next.val < nextNode.val) { + currentIterateNode = currentIterateNode.next; + } + + // link + lastSortedNode.next = nextNode.next; + + // swap + const swapNode = currentIterateNode.next; + currentIterateNode.next = nextNode; + nextNode.next = swapNode; + lastSortedNode = swapNode as ListNode; + } + } + + return dumpyHead.next; +}; \ No newline at end of file From 5dcec7238784e2e3079eed5bc49f52bf27b882f8 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Tue, 5 Jul 2022 11:10:16 +0800 Subject: [PATCH 50/53] update: 217 --- README.md | 2 +- src/contains-duplicate/res.ts | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 src/contains-duplicate/res.ts diff --git a/README.md b/README.md index 259c39c..f0584c3 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 210 | [Course Schedule II](https://leetcode.com/problems/course-schedule-ii/) | [JavaScript](./src/course-schedule-ii/res.js) | Medium | | 213 | [house-robber-ii](https://leetcode.com/problems/house-robber-ii/) | [TypeScript](./src/house-robber-ii/res.ts) | Medium | | 215 | [Kth Largest Element in an Array](https://leetcode.com/problems/kth-largest-element-in-an-array/) | [JavaScript](./src/kth-largest-element-in-an-array/res.js) | Medium | -| 217 | [Contains Duplicate](https://leetcode.com/problems/contains-duplicate/) | [JavaScript](./src/contains-duplicate/res.js) | Easy | +| 217 | [Contains Duplicate](https://leetcode.com/problems/contains-duplicate/) | [JavaScript](./src/contains-duplicate/res.js) · [TypeScript](./src/contains-duplicate/res.ts) | Easy | | 219 | [Contains Duplicate II](https://leetcode.com/problems/contains-duplicate-ii/) | [JavaScript](./src/contains-duplicate-ii/res.js) | Easy | | 220 | [Contains Duplicate III](https://leetcode.com/problems/contains-duplicate-iii/) | [JavaScript](./src/contains-duplicate-iii/res.js) | Medium | | 228 | [Summary Ranges](https://leetcode.com/problems/summary-ranges/solution/) | [JavaScript](./src/summary-ranges/res.js) | Medium | diff --git a/src/contains-duplicate/res.ts b/src/contains-duplicate/res.ts new file mode 100644 index 0000000..5471568 --- /dev/null +++ b/src/contains-duplicate/res.ts @@ -0,0 +1,15 @@ +function containsDuplicate(nums: number[]): boolean { + if (nums.length < 2) { + return false; + } + + nums.sort((a, b) => a - b); + + for (let i = 1; i < nums.length; i++) { + if (nums[i] === nums[i-1]) { + return true; + } + } + + return false; +}; \ No newline at end of file From 94990406051a27f3d634e0847ca31111bf76f0c0 Mon Sep 17 00:00:00 2001 From: hijiangtao Date: Tue, 5 Jul 2022 11:28:28 +0800 Subject: [PATCH 51/53] update: 220 --- README.md | 2 +- src/contains-duplicate-iii/res.ts | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 src/contains-duplicate-iii/res.ts diff --git a/README.md b/README.md index f0584c3..4d93813 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | 215 | [Kth Largest Element in an Array](https://leetcode.com/problems/kth-largest-element-in-an-array/) | [JavaScript](./src/kth-largest-element-in-an-array/res.js) | Medium | | 217 | [Contains Duplicate](https://leetcode.com/problems/contains-duplicate/) | [JavaScript](./src/contains-duplicate/res.js) · [TypeScript](./src/contains-duplicate/res.ts) | Easy | | 219 | [Contains Duplicate II](https://leetcode.com/problems/contains-duplicate-ii/) | [JavaScript](./src/contains-duplicate-ii/res.js) | Easy | -| 220 | [Contains Duplicate III](https://leetcode.com/problems/contains-duplicate-iii/) | [JavaScript](./src/contains-duplicate-iii/res.js) | Medium | +| 220 | [Contains Duplicate III](https://leetcode.com/problems/contains-duplicate-iii/) | [JavaScript](./src/contains-duplicate-iii/res.js) · [TypeScript](./src/contains-duplicate-iii/res.ts) | Medium | | 228 | [Summary Ranges](https://leetcode.com/problems/summary-ranges/solution/) | [JavaScript](./src/summary-ranges/res.js) | Medium | | 230 | [kth-smallest-element-in-a-bst](https://leetcode.com/problems/kth-smallest-element-in-a-bst/solution/) | [TypeScript](./src/kth-smallest-element-in-a-bst/res.ts) | Medium | | 238 | [Product of Array Except Self](https://leetcode.com/problems/product-of-array-except-self/solution/) | [JavaScript](./src/product-of-array-except-self/res.js) | Medium | diff --git a/src/contains-duplicate-iii/res.ts b/src/contains-duplicate-iii/res.ts new file mode 100644 index 0000000..876ca39 --- /dev/null +++ b/src/contains-duplicate-iii/res.ts @@ -0,0 +1,23 @@ +function containsNearbyAlmostDuplicate(nums: number[], k: number, t: number): boolean { + if (nums.length < 2) { + return false; + } + + const numsList = nums.map((num, index) => ({ + val: num, + index, + })); + numsList.sort((a, b) => a.val - b.val); + + for (let i = 0; i < numsList.length-1; i++) { + for (let j = i+1; j < numsList.length; j++) { + if (Math.abs(numsList[j].val - numsList[i].val) > t) { + break; + } else if (Math.abs(numsList[j].val - numsList[i].val) <= t && Math.abs(numsList[j].index - numsList[i].index) <= k) { + return true; + } + } + } + + return false; +}; \ No newline at end of file From aec6f6c006298e8c831e3e0f68e64e3cf21b0da1 Mon Sep 17 00:00:00 2001 From: Ali Bektash Date: Mon, 15 Aug 2022 16:33:28 +0900 Subject: [PATCH 52/53] feat: Typescript #1 two sum (#1) --- README.md | 2 +- src/two-sum/res.ts | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 src/two-sum/res.ts diff --git a/README.md b/README.md index 4d93813..f5edef8 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This is the solutions collection of my LeetCode submissions, most of them are pr | ID | Title | Solution | Difficulty | |-----|-------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------| -| 1 | [Two Sum](https://leetcode.com/problems/two-sum/) | [JavaScript](./src/two-sum/res.js) | Easy | +| 1 | [Two Sum](https://leetcode.com/problems/two-sum/) | [JavaScript](./src/two-sum/res.js)· [TypeScript](./src/two-sum/res.ts) | Easy | | 2 | [Add Two Numbers](https://leetcode.com/problems/add-two-numbers/) | [JavaScript](./src/add-two-numbers/res.js) | Medium | | 3 | [Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | [JavaScript](./src/longest-substring-without-repeating-characters/res.js) | Medium | | 4 | [Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/) | [JavaScript](./src/median-of-two-sorted-arrays/res.js) | Hard | diff --git a/src/two-sum/res.ts b/src/two-sum/res.ts new file mode 100644 index 0000000..10004d6 --- /dev/null +++ b/src/two-sum/res.ts @@ -0,0 +1,28 @@ +/** + * Problem: Given an array of integers, return indices of the two numbers such that they add up to a specific target. + * + * You may assume that each input would have exactly one solution, and you may not use the same element twice. + * + * + * @param {number[]} nums + * @param {number} target + * @return {number[]} + */ + + const twoSum =(nums:Array, target:number): Array => { + + for (let i = nums.length - 1; i >= 0; i--) { + for (let j = 0; j < i; j++) { + if ( addition(nums[i], nums[j]) === target ) { + return [j, i]; + } + } + } + + return []; +}; + +// add a with b and return it +const addition = (a:number, b:number) => { + return a + b; +}; \ No newline at end of file From 4c0b71235068a622a844ee2cdd30f1353dc2aed3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jan 2024 17:04:28 +0800 Subject: [PATCH 53/53] build(deps-dev): bump word-wrap from 1.2.3 to 1.2.4 (#2) Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4. - [Release notes](https://github.com/jonschlinkert/word-wrap/releases) - [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4) --- updated-dependencies: - dependency-name: word-wrap dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2f2cf84..0ee53a1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2478,11 +2478,10 @@ } }, "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://mirrors.tencent.com/npm/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", "dev": true, - "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -4137,9 +4136,9 @@ } }, "word-wrap": { - "version": "1.2.3", - "resolved": "https://mirrors.tencent.com/npm/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", "dev": true }, "wrappy": {