4 | {{ .Title }} 5 |
6 | {{ partial "docs/post-meta" . }} 7 |8 | {{- .Content -}} 9 |
10 |├── website ├── content │ ├── docs │ │ ├── shortcodes │ │ │ ├── section │ │ │ │ ├── page1.md │ │ │ │ ├── page2.md │ │ │ │ └── _index.md │ │ │ ├── _index.md │ │ │ ├── buttons.md │ │ │ └── details.md │ │ └── example │ │ │ └── collapsed │ │ │ └── 3rd-level │ │ │ └── 4th-level.md │ ├── ChapterTwo │ │ └── Binary_Indexed_Tree.md │ ├── ChapterThree │ │ └── _index.md │ └── ChapterFour │ │ └── _index.md ├── themes │ └── book │ │ ├── layouts │ │ ├── partials │ │ │ └── docs │ │ │ │ ├── inject │ │ │ │ ├── footer.html │ │ │ │ ├── content-after.html │ │ │ │ ├── content-before.html │ │ │ │ ├── menu-after.html │ │ │ │ └── menu-before.html │ │ │ │ ├── toc.html │ │ │ │ ├── comments.html │ │ │ │ ├── menu-bundle.html │ │ │ │ ├── date.html │ │ │ │ ├── title.html │ │ │ │ ├── post-meta.html │ │ │ │ ├── header.html │ │ │ │ └── taxonomy.html │ │ ├── _default │ │ │ ├── list.html │ │ │ ├── single.html │ │ │ └── _markup │ │ │ │ └── render-heading.html │ │ ├── shortcodes │ │ │ ├── hint.html │ │ │ ├── columns.html │ │ │ ├── section.html │ │ │ ├── details.html │ │ │ ├── button.html │ │ │ ├── mermaid.html │ │ │ ├── tab.html │ │ │ ├── expand.html │ │ │ ├── tabs.html │ │ │ └── katex.html │ │ ├── posts │ │ │ ├── single.html │ │ │ └── list.html │ │ └── taxonomy │ │ │ ├── list.html │ │ │ └── taxonomy.html │ │ ├── .gitignore │ │ ├── exampleSite │ │ ├── content │ │ │ ├── docs │ │ │ │ ├── shortcodes │ │ │ │ │ ├── section │ │ │ │ │ │ ├── page1.md │ │ │ │ │ │ ├── page2.md │ │ │ │ │ │ └── _index.md │ │ │ │ │ ├── _index.md │ │ │ │ │ ├── buttons.md │ │ │ │ │ └── details.md │ │ │ │ └── example │ │ │ │ │ └── collapsed │ │ │ │ │ └── 3rd-level │ │ │ │ │ └── 4th-level.md │ │ │ └── posts │ │ │ │ └── _index.md │ │ ├── assets │ │ │ ├── _variables.scss │ │ │ └── _custom.scss │ │ └── resources │ │ │ └── _gen │ │ │ └── assets │ │ │ └── scss │ │ │ ├── book.scss_50fc8c04e12a2f59027287995557ceff.json │ │ │ └── example │ │ │ └── book.scss_50fc8c04e12a2f59027287995557ceff.json │ │ ├── images │ │ ├── tn.png │ │ └── screenshot.png │ │ ├── archetypes │ │ ├── posts.md │ │ └── docs.md │ │ ├── assets │ │ ├── _variables.scss │ │ ├── sw-register.js │ │ ├── plugins │ │ │ ├── _dark.scss │ │ │ └── _scrollbars.scss │ │ ├── book.scss │ │ ├── menu-reset.js │ │ └── _print.scss │ │ ├── static │ │ ├── favicon.png │ │ ├── LeetCode_Icon.png │ │ ├── LeetCode_logo.png │ │ ├── LeetCode_logo2048.png │ │ ├── apple-touch-icon-120x120.png │ │ ├── apple-touch-icon-152x152.png │ │ ├── apple-touch-icon-180x180.png │ │ ├── apple-touch-icon-512x512.png │ │ ├── apple-touch-icon-60x60.png │ │ ├── apple-touch-icon-76x76.png │ │ ├── apple-touch-icon-1024x1024.png │ │ ├── fonts │ │ │ ├── roboto-v19-latin-700.woff │ │ │ ├── roboto-v19-latin-700.woff2 │ │ │ ├── roboto-v19-latin-regular.woff │ │ │ ├── roboto-v19-latin-300italic.woff │ │ │ ├── roboto-v19-latin-300italic.woff2 │ │ │ ├── roboto-v19-latin-regular.woff2 │ │ │ ├── roboto-mono-v6-latin-regular.woff │ │ │ └── roboto-mono-v6-latin-regular.woff2 │ │ ├── katex │ │ │ └── fonts │ │ │ │ ├── KaTeX_AMS-Regular.ttf │ │ │ │ ├── KaTeX_Main-Bold.ttf │ │ │ │ ├── KaTeX_Main-Bold.woff │ │ │ │ ├── KaTeX_Main-Bold.woff2 │ │ │ │ ├── KaTeX_Main-Italic.ttf │ │ │ │ ├── KaTeX_Math-Italic.ttf │ │ │ │ ├── KaTeX_AMS-Regular.woff │ │ │ │ ├── KaTeX_AMS-Regular.woff2 │ │ │ │ ├── KaTeX_Fraktur-Bold.ttf │ │ │ │ ├── KaTeX_Fraktur-Bold.woff │ │ │ │ ├── KaTeX_Main-Italic.woff │ │ │ │ ├── KaTeX_Main-Italic.woff2 │ │ │ │ ├── KaTeX_Main-Regular.ttf │ │ │ │ ├── KaTeX_Main-Regular.woff │ │ │ │ ├── KaTeX_Math-Italic.woff │ │ │ │ ├── KaTeX_Math-Italic.woff2 │ │ │ │ ├── KaTeX_Size1-Regular.ttf │ │ │ │ ├── KaTeX_Size2-Regular.ttf │ │ │ │ ├── KaTeX_Size3-Regular.ttf │ │ │ │ ├── KaTeX_Size4-Regular.ttf │ │ │ │ ├── KaTeX_Caligraphic-Bold.ttf │ │ │ │ ├── KaTeX_Fraktur-Bold.woff2 │ │ │ │ ├── KaTeX_Fraktur-Regular.ttf │ │ │ │ ├── KaTeX_Fraktur-Regular.woff │ │ │ │ ├── KaTeX_Main-BoldItalic.ttf │ │ │ │ ├── KaTeX_Main-BoldItalic.woff │ │ │ │ ├── KaTeX_Main-Regular.woff2 │ │ │ │ ├── KaTeX_Math-BoldItalic.ttf │ │ │ │ ├── KaTeX_Math-BoldItalic.woff │ │ │ │ ├── KaTeX_SansSerif-Bold.ttf │ │ │ │ ├── KaTeX_SansSerif-Bold.woff │ │ │ │ ├── KaTeX_SansSerif-Bold.woff2 │ │ │ │ ├── KaTeX_SansSerif-Italic.ttf │ │ │ │ ├── KaTeX_Script-Regular.ttf │ │ │ │ ├── KaTeX_Script-Regular.woff │ │ │ │ ├── KaTeX_Script-Regular.woff2 │ │ │ │ ├── KaTeX_Size1-Regular.woff │ │ │ │ ├── KaTeX_Size1-Regular.woff2 │ │ │ │ ├── KaTeX_Size2-Regular.woff │ │ │ │ ├── KaTeX_Size2-Regular.woff2 │ │ │ │ ├── KaTeX_Size3-Regular.woff │ │ │ │ ├── KaTeX_Size3-Regular.woff2 │ │ │ │ ├── KaTeX_Size4-Regular.woff │ │ │ │ ├── KaTeX_Size4-Regular.woff2 │ │ │ │ ├── KaTeX_Caligraphic-Bold.woff │ │ │ │ ├── KaTeX_Caligraphic-Bold.woff2 │ │ │ │ ├── KaTeX_Fraktur-Regular.woff2 │ │ │ │ ├── KaTeX_Main-BoldItalic.woff2 │ │ │ │ ├── KaTeX_Math-BoldItalic.woff2 │ │ │ │ ├── KaTeX_SansSerif-Italic.woff │ │ │ │ ├── KaTeX_SansSerif-Italic.woff2 │ │ │ │ ├── KaTeX_SansSerif-Regular.ttf │ │ │ │ ├── KaTeX_SansSerif-Regular.woff │ │ │ │ ├── KaTeX_Typewriter-Regular.ttf │ │ │ │ ├── KaTeX_Caligraphic-Regular.ttf │ │ │ │ ├── KaTeX_Caligraphic-Regular.woff │ │ │ │ ├── KaTeX_Caligraphic-Regular.woff2 │ │ │ │ ├── KaTeX_SansSerif-Regular.woff2 │ │ │ │ ├── KaTeX_Typewriter-Regular.woff │ │ │ │ └── KaTeX_Typewriter-Regular.woff2 │ │ └── svg │ │ │ ├── menu.svg │ │ │ ├── toc.svg │ │ │ ├── calendar.svg │ │ │ ├── edit.svg │ │ │ └── translate.svg │ │ ├── i18n │ │ ├── nb.yaml │ │ ├── en.yaml │ │ ├── de.yaml │ │ ├── pt.yaml │ │ ├── sv.yaml │ │ ├── es.yaml │ │ ├── cs.yaml │ │ ├── fr.yaml │ │ ├── uk.yaml │ │ ├── ru.yaml │ │ ├── zh.yaml │ │ ├── ja.yaml │ │ ├── ko.yaml │ │ ├── cn.yaml │ │ └── jp.yaml │ │ └── theme.toml ├── static │ └── logo.png ├── archetypes │ └── default.md └── resources │ └── _gen │ └── assets │ └── scss │ ├── book.scss_50fc8c04e12a2f59027287995557ceff.json │ └── leetcode │ └── book.scss_50fc8c04e12a2f59027287995557ceff.json ├── logo.png ├── topic ├── Sort.png ├── Stack.png ├── Union_Find.png ├── Backtracking.png ├── Linked_List.png ├── Segment_Tree.png ├── Two_pointers.png ├── Sliding_Window.png ├── Bit_Manipulation.png └── Binary_Indexed_Tree.png ├── leetcode ├── 1025.Divisor-Game │ └── 1025. Divisor Game.go ├── 9990085.Maximal-Rectangle │ └── 85. Maximal Rectangle.go ├── 0141.Linked-List-Cycle │ ├── 141. Linked List Cycle_test.go │ ├── README.md │ └── 141. Linked List Cycle.go ├── 0142.Linked-List-Cycle-II │ └── 142. Linked List Cycle II_test.go ├── 9990316.Remove-Duplicate-Letters │ └── 316. Remove Duplicate Letters.go ├── 0172.Factorial-Trailing-Zeroes │ └── 172. Factorial Trailing Zeroes.go ├── 0344.Reverse-String │ └── 344. Reverse String.go ├── 1108.Defanging-an-IP-Address │ └── 1108. Defanging an IP Address.go ├── 0136.Single-Number │ └── 136. Single Number.go ├── 0263.Ugly-Number │ └── 263. Ugly Number.go ├── 0836.Rectangle-Overlap │ └── 836. Rectangle Overlap.go ├── 0268.Missing-Number │ └── 268. Missing Number.go ├── 0190.Reverse-Bits │ └── 190. Reverse Bits.go ├── 0338.Counting-Bits │ └── 338. Counting Bits.go ├── 0461.Hamming-Distance │ └── 461. Hamming Distance.go ├── 1037.Valid-Boomerang │ └── 1037. Valid Boomerang.go ├── 0258.Add-Digits │ └── 258. Add Digits.go ├── 1185.Day-of-the-Week │ └── 1185. Day of the Week.go ├── 0070.Climbing-Stairs │ └── 70. Climbing Stairs.go ├── 0206.Reverse-Linked-List │ ├── README.md │ └── 206. Reverse Linked List.go ├── 0389.Find-the-Difference │ └── 389. Find the Difference.go ├── 0007.Reverse-Integer │ └── 7. Reverse Integer.go ├── 0171.Excel-Sheet-Column-Number │ └── 171. Excel Sheet Column Number.go ├── 1089.Duplicate-Zeros │ └── 1089. Duplicate Zeros.go ├── 0001.Two-Sum │ └── 1. Two Sum.go ├── 0717.1-bit-and-2-bit-Characters │ └── 717. 1-bit and 2-bit Characters.go ├── 0371.Sum-of-Two-Integers │ └── 371. Sum of Two Integers.go ├── 1470.Shuffle-the-Array │ └── 1470. Shuffle the Array.go ├── 1295.Find-Numbers-with-Even-Number-of-Digits │ └── 1295. Find Numbers with Even Number of Digits.go ├── 1137.N-th-Tribonacci-Number │ └── 1137. N-th Tribonacci Number.go ├── 0096.Unique-Binary-Search-Trees │ └── 96. Unique Binary Search Trees.go ├── 0781.Rabbits-in-Forest │ └── 781. Rabbits in Forest.go ├── 0217.Contains-Duplicate │ └── 217. Contains Duplicate.go ├── 1287.Element-Appearing-More-Than-In-Sorted-Array │ └── 1287. Element Appearing More Than 25% In Sorted Array.go ├── 0122.Best-Time-to-Buy-and-Sell-Stock-II │ └── 122. Best Time to Buy and Sell Stock II.go ├── 0283.Move-Zeroes │ ├── 283. Move Zeroes.go │ └── README.md ├── 0961.N-Repeated-Element-in-Size-2N-Array │ └── 961. N-Repeated Element in Size 2N Array.go ├── 1281.Subtract-the-Product-and-Sum-of-Digits-of-an-Integer │ └── 1281. Subtract the Product and Sum of Digits of an Integer.go ├── 1313.Decompress-Run-Length-Encoded-List │ └── 1313. Decompress Run-Length Encoded List.go ├── 1306.Jump-Game-III │ └── 1306. Jump Game III.go ├── 0453.Minimum-Moves-to-Equal-Array-Elements │ └── 453. Minimum Moves to Equal Array Elements.go ├── 0575.Distribute-Candies │ └── 575. Distribute Candies.go ├── 1389.Create-Target-Array-in-the-Given-Order │ └── 1389. Create Target Array in the Given Order.go ├── 0766.Toeplitz-Matrix │ └── 766. Toeplitz Matrix.go ├── 1154.Day-of-the-Year │ └── 1154. Day of the Year.go ├── 1221.Split-a-String-in-Balanced-Strings │ └── 1221. Split a String in Balanced Strings.go ├── 0275.H-Index-II │ └── 275. H-Index II.go ├── 0397.Integer-Replacement │ └── 397. Integer Replacement.go ├── 0891.Sum-of-Subsequence-Widths │ └── 891. Sum of Subsequence Widths.go ├── 0191.Number-of-1-Bits │ └── 191. Number of 1 Bits.go ├── 0387.First-Unique-Character-in-a-String │ ├── 387. First Unique Character in a String.go │ └── README.md ├── 1304.Find-N-Unique-Integers-Sum-up-to-Zero │ └── 1304. Find N Unique Integers Sum up to Zero.go ├── 0050.Powx-n │ └── 50. Pow(x, n).go ├── 0598.Range-Addition-II │ └── 598. Range Addition II.go ├── 1051.Height-Checker │ └── 1051. Height Checker.go ├── 0350.Intersection-of-Two-Arrays-II │ └── 350. Intersection of Two Arrays II.go ├── 0367.Valid-Perfect-Square │ └── 367. Valid Perfect Square.go ├── 0409.Longest-Palindrome │ └── 409. Longest Palindrome.go ├── 0455.Assign-Cookies │ └── 455. Assign Cookies.go ├── 0832.Flipping-an-Image │ └── 832. Flipping an Image.go ├── 0349.Intersection-of-Two-Arrays │ └── 349. Intersection of Two Arrays.go ├── 1217.Play-with-Chips │ └── 1217. Play with Chips.go ├── 0342.Power-of-Four │ └── 342. Power of Four.go ├── 0454.4Sum-II │ └── 454. 4Sum II.go ├── 0704.Binary-Search │ └── 704. Binary Search.go ├── 0867.Transpose-Matrix │ └── 867. Transpose Matrix.go ├── 0027.Remove-Element │ └── 27. Remove Element.go ├── 0041.First-Missing-Positive │ └── 41. First Missing Positive.go ├── 0485.Max-Consecutive-Ones │ └── 485. Max Consecutive Ones.go ├── 0633.Sum-of-Square-Numbers │ └── 633. Sum of Square Numbers.go ├── 1207.Unique-Number-of-Occurrences │ └── 1207. Unique Number of Occurrences.go ├── 0168.Excel-Sheet-Column-Title │ └── 168. Excel Sheet Column Title.go ├── 0009.Palindrome-Number │ └── 9. Palindrome Number.go ├── 0441.Arranging-Coins │ └── 441. Arranging Coins.go ├── 0645.Set-Mismatch │ └── 645. Set Mismatch.go ├── 1017.Convert-to-Base--2 │ └── 1017. Convert to Base -2.go ├── 1464.Maximum-Product-of-Two-Elements-in-an-Array │ └── 1464. Maximum Product of Two Elements in an Array.go ├── 1455.Check-If-a-Word-Occurs-As-a-Prefix-of-Any-Word-in-a-Sentence │ └── 1455. Check If a Word Occurs As a Prefix of Any Word in a Sentence.go ├── 0151.Reverse-Words-in-a-String │ └── 151. Reverse Words in a String.go ├── 0386.Lexicographical-Numbers │ ├── 386. Lexicographical Numbers.go │ └── README.md ├── 1047.Remove-All-Adjacent-Duplicates-In-String │ └── 1047. Remove All Adjacent Duplicates In String.go ├── 0203.Remove-Linked-List-Elements │ └── README.md ├── 0942.DI-String-Match │ └── 942. DI String Match.go ├── 0204.Count-Primes │ ├── 204. Count Primes.go │ └── README.md ├── 0035.Search-Insert-Position │ └── 35. Search Insert Position.go ├── 0561.Array-Partition-I │ └── 561. Array Partition I.go ├── 1299.Replace-Elements-with-Greatest-Element-on-Right-Side │ └── 1299. Replace Elements with Greatest Element on Right Side.go ├── 0331.Verify-Preorder-Serialization-of-a-Binary-Tree │ └── 331. Verify Preorder Serialization of a Binary Tree.go ├── 0745.Prefix-and-Suffix-Search │ └── 745. Prefix and Suffix Search_test.go ├── 0448.Find-All-Numbers-Disappeared-in-an-Array │ └── 448. Find All Numbers Disappeared in an Array.go ├── 0118.Pascals-Triangle │ └── 118. Pascal's Triangle.go ├── 0343.Integer-Break │ └── 343. Integer Break.go ├── 0724.Find-Pivot-Index │ └── 724. Find Pivot Index.go ├── 1005.Maximize-Sum-Of-Array-After-K-Negations │ └── 1005. Maximize Sum Of Array After K Negations.go ├── 0021.Merge-Two-Sorted-Lists │ ├── README.md │ └── 21. Merge Two Sorted Lists.go ├── 0055.Jump-Game │ └── 55. Jump Game.go ├── 0062.Unique-Paths │ └── 62. Unique Paths.go ├── 0066.Plus-One │ └── 66. Plus One.go ├── 0720.Longest-Word-in-Dictionary │ └── 720. Longest Word in Dictionary.go ├── 1078.Occurrences-After-Bigram │ └── 1078. Occurrences After Bigram.go ├── 0884.Uncommon-Words-from-Two-Sentences │ └── 884. Uncommon Words from Two Sentences.go ├── 0973.K-Closest-Points-to-Origin │ └── 973. K Closest Points to Origin.go ├── 0981.Time-Based-Key-Value-Store │ └── 981. Time Based Key-Value Store_test.go ├── 0201.Bitwise-AND-of-Numbers-Range │ └── 201. Bitwise AND of Numbers Range.go ├── 0922.Sort-Array-By-Parity-II │ └── 922. Sort Array By Parity II.go ├── 0470.Implement-Rand10-Using-Rand7 │ └── 470. Implement Rand10() Using Rand7().go ├── 0706.Design-HashMap │ └── 706. Design HashMap_test.go ├── 0881.Boats-to-Save-People │ └── 881. Boats to Save People.go ├── 1260.Shift-2D-Grid │ └── 1260. Shift 2D Grid.go ├── 0011.Container-With-Most-Water │ └── 11. Container With Most Water.go ├── 0154.Find-Minimum-in-Rotated-Sorted-Array-II │ └── 154. Find Minimum in Rotated Sorted Array II.go ├── 0532.K-diff-Pairs-in-an-Array │ └── 532. K-diff Pairs in an Array.go ├── 0735.Asteroid-Collision │ └── 735. Asteroid Collision.go ├── 0303.Range-Sum-Query---Immutable │ └── 303. Range Sum Query - Immutable_test.go ├── 0414.Third-Maximum-Number │ └── 414. Third Maximum Number.go ├── 0744.Find-Smallest-Letter-Greater-Than-Target │ └── 744. Find Smallest Letter Greater Than Target.go ├── 0762.Prime-Number-of-Set-Bits-in-Binary-Representation │ └── 762. Prime Number of Set Bits in Binary Representation.go ├── 0841.Keys-and-Rooms │ └── 841. Keys and Rooms.go ├── 0023.Merge-k-Sorted-Lists │ └── README.md ├── 0219.Contains-Duplicate-II │ └── 219. Contains Duplicate II.go ├── 0985.Sum-of-Even-Numbers-After-Queries │ └── 985. Sum of Even Numbers After Queries.go ├── 1157.Online-Majority-Element-In-Subarray │ └── 1157. Online Majority Element In Subarray_test.go ├── 0024.Swap-Nodes-in-Pairs │ └── README.md ├── 0930.Binary-Subarrays-With-Sum │ └── 930. Binary Subarrays With Sum.go ├── 1385.Find-the-Distance-Value-Between-Two-Arrays │ └── 1385. Find the Distance Value Between Two Arrays.go ├── 0412.Fizz-Buzz │ └── 412. Fizz Buzz.go ├── 0921.Minimum-Add-to-Make-Parentheses-Valid │ └── 921. Minimum Add to Make Parentheses Valid.go ├── 1232.Check-If-It-Is-a-Straight-Line │ └── 1232. Check If It Is a Straight Line.go ├── 0074.Search-a-2D-Matrix │ └── 74. Search a 2D Matrix.go ├── 0075.Sort-Colors │ └── 75. Sort Colors.go ├── 0093.Restore-IP-Addresses │ └── README.md ├── 0202.Happy-Number │ └── 202. Happy Number.go ├── 0260.Single-Number-III │ └── 260. Single Number III.go ├── 0914.X-of-a-Kind-in-a-Deck-of-Cards │ └── 914. X of a Kind in a Deck of Cards.go ├── 1266.Minimum-Time-Visiting-All-Points │ └── 1266. Minimum Time Visiting All Points.go ├── 0933.Number-of-Recent-Calls │ └── 933. Number of Recent Calls_test.go ├── 0920.Number-of-Music-Playlists │ └── 920. Number of Music Playlists.go ├── 0148.Sort-List │ └── README.md ├── 0557.Reverse-Words-in-a-String-III │ └── 557. Reverse Words in a String III.go ├── 0083.Remove-Duplicates-from-Sorted-List │ └── README.md ├── 0404.Sum-of-Left-Leaves │ └── README.md ├── 0416.Partition-Equal-Subset-Sum │ └── 416. Partition Equal Subset Sum.go ├── 0028.Implement-strStr │ └── 28. Implement strStr().go ├── 0046.Permutations │ └── README.md ├── 0599.Minimum-Index-Sum-of-Two-Lists │ └── 599. Minimum Index Sum of Two Lists.go ├── 0077.Combinations │ ├── README.md │ └── 77. Combinations.go ├── 0402.Remove-K-Digits │ └── 402. Remove K Digits.go ├── 0155.Min-Stack │ └── 155. Min Stack_test.go ├── 0594.Longest-Harmonious-Subsequence │ └── 594. Longest Harmonious Subsequence.go ├── 0946.Validate-Stack-Sequences │ └── 946. Validate Stack Sequences.go ├── 1317.Convert-Integer-to-the-Sum-of-Two-No-Zero-Integers │ └── 1317. Convert Integer to the Sum of Two No-Zero Integers.go ├── 0497.Random-Point-in-Non-overlapping-Rectangles │ └── 497. Random Point in Non-overlapping Rectangles_test.go ├── 0524.Longest-Word-in-Dictionary-through-Deleting │ └── 524. Longest Word in Dictionary through Deleting.go ├── 1175.Prime-Arrangements │ └── 1175. Prime Arrangements.go ├── 1184.Distance-Between-Bus-Stops │ └── 1184. Distance Between Bus Stops.go ├── 0447.Number-of-Boomerangs │ └── 447. Number of Boomerangs.go ├── 0676.Implement-Magic-Dictionary │ └── 676. Implement Magic Dictionary_test.go ├── 0844.Backspace-String-Compare │ └── 844. Backspace String Compare.go ├── 0307.Range-Sum-Query---Mutable │ └── 307. Range Sum Query - Mutable_test.go ├── 0507.Perfect-Number │ └── 507. Perfect Number.go ├── 0528.Random-Pick-with-Weight │ └── 528. Random Pick with Weight_test.go ├── 0713.Subarray-Product-Less-Than-K │ └── 713. Subarray Product Less Than K.go ├── 0765.Couples-Holding-Hands │ └── 765. Couples Holding Hands.go ├── 0232.Implement-Queue-using-Stacks │ └── 232. Implement Queue using Stacks_test.go ├── 0476.Number-Complement │ └── 476. Number Complement.go ├── 0345.Reverse-Vowels-of-a-String │ └── README.md ├── 0732.My-Calendar-III │ └── 732. My Calendar III_test.go ├── 0013.Roman-to-Integer │ └── 13. Roman to Integer.go ├── 0131.Palindrome-Partitioning │ └── README.md ├── 0322.Coin-Change │ └── 322. Coin Change.go ├── 0977.Squares-of-a-Sorted-Array │ └── 977. Squares of a Sorted Array.go ├── 0082.Remove-Duplicates-from-Sorted-List-II │ └── README.md ├── 0995.Minimum-Number-of-K-Consecutive-Bit-Flips │ └── 995. Minimum Number of K Consecutive Bit Flips.go ├── 1290.Convert-Binary-Number-in-a-Linked-List-to-Integer │ └── 1290. Convert Binary Number in a Linked List to Integer.go ├── 0042.Trapping-Rain-Water │ └── 42. Trapping Rain Water.go ├── 0771.Jewels-and-Stones │ └── 771. Jewels and Stones.go ├── 1200.Minimum-Absolute-Difference │ └── 1200. Minimum Absolute Difference.go ├── 0424.Longest-Repeating-Character-Replacement │ └── 424. Longest Repeating Character Replacement.go ├── 0463.Island-Perimeter │ └── 463. Island Perimeter.go ├── 0537.Complex-Number-Multiplication │ └── 537. Complex Number Multiplication.go ├── 0144.Binary-Tree-Preorder-Traversal │ └── README.md ├── 0684.Redundant-Connection │ └── 684. Redundant Connection.go ├── 0885.Spiral-Matrix-III │ └── 885. Spiral Matrix III.go ├── 1189.Maximum-Number-of-Balloons │ └── 1189. Maximum Number of Balloons.go ├── 0658.Find-K-Closest-Elements │ └── 658. Find K Closest Elements.go ├── 0094.Binary-Tree-Inorder-Traversal │ └── README.md ├── 0145.Binary-Tree-Postorder-Traversal │ └── README.md ├── 0257.Binary-Tree-Paths │ └── README.md ├── 0047.Permutations-II │ └── README.md ├── 0059.Spiral-Matrix-II │ └── README.md ├── 0091.Decode-Ways │ └── 91. Decode Ways.go ├── 0226.Invert-Binary-Tree │ └── 226. Invert Binary Tree.go ├── 0541.Reverse-String-II │ └── 541. Reverse String II.go ├── 0668.Kth-Smallest-Number-in-Multiplication-Table │ └── 668. Kth Smallest Number in Multiplication Table.go ├── 0896.Monotonic-Array │ └── 896. Monotonic Array.go ├── 9990377.Combination-Sum-IV │ └── 377. Combination Sum IV.go ├── 0125.Valid-Palindrome │ ├── 125. Valid Palindrome.go │ └── README.md ├── 0237.Delete-Node-in-a-Linked-List │ └── 237. Delete Node in a Linked List.go ├── 0500.Keyboard-Row │ └── 500. Keyboard Row.go ├── 0405.Convert-a-Number-to-Hexadecimal │ └── 405. Convert a Number to Hexadecimal.go ├── 0223.Rectangle-Area │ └── 223. Rectangle Area.go ├── 0515.Find-Largest-Value-in-Each-Tree-Row │ └── README.md ├── 0878.Nth-Magical-Number │ └── 878. Nth Magical Number.go ├── 0925.Long-Pressed-Name │ └── 925. Long Pressed Name.go ├── 1004.Max-Consecutive-Ones-III │ └── 1004. Max Consecutive Ones III.go ├── 0225.Implement-Stack-using-Queues │ └── 225. Implement Stack using Queues_test.go ├── 1380.Lucky-Numbers-in-a-Matrix │ └── 1380. Lucky Numbers in a Matrix.go ├── 0022.Generate-Parentheses │ └── 22. Generate Parentheses.go ├── 0152.Maximum-Product-Subarray │ └── 152. Maximum Product Subarray.go ├── 0209.Minimum-Size-Subarray-Sum │ └── 209. Minimum Size Subarray Sum.go ├── 0393.UTF-8-Validation │ └── 393. UTF-8 Validation.go ├── 0088.Merge-Sorted-Array │ ├── README.md │ └── 88. Merge Sorted Array.go ├── 0169.Majority-Element │ └── 169. Majority Element.go ├── 0231.Power-of-Two │ └── README.md ├── 0496.Next-Greater-Element-I │ └── 496. Next Greater Element I.go ├── 0020.Valid-Parentheses │ └── 20. Valid Parentheses.go ├── 0112.Path-Sum │ └── 112. Path Sum.go ├── 1049.Last-Stone-Weight-II │ └── 1049. Last Stone Weight II.go ├── 0207.Course-Schedule │ └── 207. Course Schedule.go ├── 1160.Find-Words-That-Can-Be-Formed-by-Characters │ └── 1160. Find Words That Can Be Formed by Characters.go ├── 0234.Palindrome-Linked-List │ └── README.md ├── 0839.Similar-String-Groups │ └── 839. Similar String Groups.go ├── 0104.Maximum-Depth-of-Binary-Tree │ └── 104. Maximum Depth of Binary Tree.go ├── 1128.Number-of-Equivalent-Domino-Pairs │ └── 1128. Number of Equivalent Domino Pairs.go ├── 0357.Count-Numbers-with-Unique-Digits │ └── 357. Count Numbers with Unique Digits.go ├── 0392.Is-Subsequence │ └── 392. Is Subsequence.go ├── 0048.Rotate-Image │ └── 48. Rotate Image.go ├── 0056.Merge-Intervals │ └── README.md ├── 0474.Ones-and-Zeroes │ └── 474. Ones and Zeroes.go ├── 0108.Convert-Sorted-Array-to-Binary-Search-Tree │ └── 108. Convert Sorted Array to Binary Search Tree.go ├── 0880.Decoded-String-at-Index │ └── 880. Decoded String at Index.go ├── 0019.Remove-Nth-Node-From-End-of-List │ └── README.md └── 0092.Reverse-Linked-List-II │ └── README.md ├── gotest.sh └── structures ├── Queue_test.go ├── Stack_test.go ├── NestedInterger_test.go ├── Point.go ├── Heap.go ├── Heap_test.go ├── Queue.go └── Stack.go /website/content/docs/shortcodes/section/page1.md: -------------------------------------------------------------------------------- 1 | # Page 1 2 | -------------------------------------------------------------------------------- /website/content/docs/shortcodes/section/page2.md: -------------------------------------------------------------------------------- 1 | # Page 2 2 | -------------------------------------------------------------------------------- /website/themes/book/layouts/partials/docs/inject/footer.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/book/layouts/partials/docs/inject/content-after.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/book/layouts/partials/docs/inject/content-before.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/book/layouts/partials/docs/inject/menu-after.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/themes/book/layouts/partials/docs/inject/menu-before.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/logo.png -------------------------------------------------------------------------------- /website/themes/book/layouts/partials/docs/toc.html: -------------------------------------------------------------------------------- 1 | {{ .TableOfContents }} 2 | -------------------------------------------------------------------------------- /topic/Sort.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/topic/Sort.png -------------------------------------------------------------------------------- /topic/Stack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/topic/Stack.png -------------------------------------------------------------------------------- /website/content/docs/shortcodes/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | bookFlatSection: true 3 | --- 4 | -------------------------------------------------------------------------------- /website/themes/book/.gitignore: -------------------------------------------------------------------------------- 1 | public/ 2 | exampleSite/public/ 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /website/themes/book/layouts/_default/list.html: -------------------------------------------------------------------------------- 1 | {{ define "dummy" }}{{ end }} 2 | -------------------------------------------------------------------------------- /website/themes/book/layouts/_default/single.html: -------------------------------------------------------------------------------- 1 | {{ define "dummy" }}{{ end }} 2 | -------------------------------------------------------------------------------- /website/themes/book/exampleSite/content/docs/shortcodes/section/page1.md: -------------------------------------------------------------------------------- 1 | # Page 1 2 | -------------------------------------------------------------------------------- /website/themes/book/exampleSite/content/docs/shortcodes/section/page2.md: -------------------------------------------------------------------------------- 1 | # Page 2 2 | -------------------------------------------------------------------------------- /topic/Union_Find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/topic/Union_Find.png -------------------------------------------------------------------------------- /topic/Backtracking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/topic/Backtracking.png -------------------------------------------------------------------------------- /topic/Linked_List.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/topic/Linked_List.png -------------------------------------------------------------------------------- /topic/Segment_Tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/topic/Segment_Tree.png -------------------------------------------------------------------------------- /topic/Two_pointers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/topic/Two_pointers.png -------------------------------------------------------------------------------- /topic/Sliding_Window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/topic/Sliding_Window.png -------------------------------------------------------------------------------- /website/static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/static/logo.png -------------------------------------------------------------------------------- /topic/Bit_Manipulation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/topic/Bit_Manipulation.png -------------------------------------------------------------------------------- /website/themes/book/exampleSite/content/docs/shortcodes/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | bookFlatSection: true 3 | --- 4 | -------------------------------------------------------------------------------- /topic/Binary_Indexed_Tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/topic/Binary_Indexed_Tree.png -------------------------------------------------------------------------------- /website/themes/book/images/tn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/images/tn.png -------------------------------------------------------------------------------- /website/themes/book/archetypes/posts.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ replace .Name "-" " " | title }}" 3 | date: {{ .Date }} 4 | --- 5 | -------------------------------------------------------------------------------- /website/themes/book/assets/_variables.scss: -------------------------------------------------------------------------------- 1 | /* You can override SASS variables here. */ 2 | 3 | // @import "plugins/dark"; 4 | -------------------------------------------------------------------------------- /website/themes/book/static/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/favicon.png -------------------------------------------------------------------------------- /leetcode/1025.Divisor-Game/1025. Divisor Game.go: -------------------------------------------------------------------------------- 1 | package leetcode 2 | 3 | func divisorGame(N int) bool { 4 | return N%2 == 0 5 | } 6 | -------------------------------------------------------------------------------- /website/archetypes/default.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: "{{ replace .Name "-" " " | title }}" 3 | date: {{ .Date }} 4 | draft: true 5 | --- 6 | 7 | -------------------------------------------------------------------------------- /website/themes/book/exampleSite/assets/_variables.scss: -------------------------------------------------------------------------------- 1 | /* You can override SASS variables here. */ 2 | 3 | // @import "plugins/dark"; 4 | -------------------------------------------------------------------------------- /website/themes/book/images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/images/screenshot.png -------------------------------------------------------------------------------- /website/themes/book/static/LeetCode_Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/LeetCode_Icon.png -------------------------------------------------------------------------------- /website/themes/book/static/LeetCode_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/LeetCode_logo.png -------------------------------------------------------------------------------- /website/themes/book/exampleSite/content/posts/_index.md: -------------------------------------------------------------------------------- 1 | --- 2 | menu: 3 | after: 4 | name: blog 5 | weight: 5 6 | title: Blog 7 | --- 8 | -------------------------------------------------------------------------------- /website/themes/book/layouts/shortcodes/hint.html: -------------------------------------------------------------------------------- 1 |
2 | {{ .Inner | markdownify }} 3 |4 | -------------------------------------------------------------------------------- /website/themes/book/static/LeetCode_logo2048.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/LeetCode_logo2048.png -------------------------------------------------------------------------------- /leetcode/9990085.Maximal-Rectangle/85. Maximal Rectangle.go: -------------------------------------------------------------------------------- 1 | package leetcode 2 | 3 | func maximalRectangle(matrix [][]byte) int { 4 | return 0 5 | } 6 | -------------------------------------------------------------------------------- /leetcode/0141.Linked-List-Cycle/141. Linked List Cycle_test.go: -------------------------------------------------------------------------------- 1 | package leetcode 2 | 3 | import "testing" 4 | 5 | func Test_Problem141(t *testing.T) { 6 | } 7 | -------------------------------------------------------------------------------- /website/themes/book/static/apple-touch-icon-120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/apple-touch-icon-120x120.png -------------------------------------------------------------------------------- /website/themes/book/static/apple-touch-icon-152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/apple-touch-icon-152x152.png -------------------------------------------------------------------------------- /website/themes/book/static/apple-touch-icon-180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/apple-touch-icon-180x180.png -------------------------------------------------------------------------------- /website/themes/book/static/apple-touch-icon-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/apple-touch-icon-512x512.png -------------------------------------------------------------------------------- /website/themes/book/static/apple-touch-icon-60x60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/apple-touch-icon-60x60.png -------------------------------------------------------------------------------- /website/themes/book/static/apple-touch-icon-76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/apple-touch-icon-76x76.png -------------------------------------------------------------------------------- /leetcode/0142.Linked-List-Cycle-II/142. Linked List Cycle II_test.go: -------------------------------------------------------------------------------- 1 | package leetcode 2 | 3 | import "testing" 4 | 5 | func Test_Problem142(t *testing.T) { 6 | } 7 | -------------------------------------------------------------------------------- /website/themes/book/static/apple-touch-icon-1024x1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/apple-touch-icon-1024x1024.png -------------------------------------------------------------------------------- /leetcode/9990316.Remove-Duplicate-Letters/316. Remove Duplicate Letters.go: -------------------------------------------------------------------------------- 1 | package leetcode 2 | 3 | func removeDuplicateLetters(s string) string { 4 | return "" 5 | } 6 | -------------------------------------------------------------------------------- /website/themes/book/exampleSite/assets/_custom.scss: -------------------------------------------------------------------------------- 1 | /* You can add custom styles here. */ 2 | 3 | // @import "plugins/numbered"; 4 | // @import "plugins/scrollbars"; 5 | -------------------------------------------------------------------------------- /website/themes/book/static/fonts/roboto-v19-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/fonts/roboto-v19-latin-700.woff -------------------------------------------------------------------------------- /website/themes/book/static/fonts/roboto-v19-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/fonts/roboto-v19-latin-700.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_AMS-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_AMS-Regular.ttf -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Main-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Main-Bold.ttf -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Main-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Main-Bold.woff -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Main-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Main-Bold.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Main-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Main-Italic.ttf -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Math-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Math-Italic.ttf -------------------------------------------------------------------------------- /website/themes/book/layouts/partials/docs/comments.html: -------------------------------------------------------------------------------- 1 | 2 | {{ template "_internal/disqus.html" . }} 3 | -------------------------------------------------------------------------------- /website/themes/book/static/fonts/roboto-v19-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/fonts/roboto-v19-latin-regular.woff -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_AMS-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_AMS-Regular.woff -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_AMS-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_AMS-Regular.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Fraktur-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Fraktur-Bold.ttf -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Fraktur-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Fraktur-Bold.woff -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Main-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Main-Italic.woff -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Main-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Main-Italic.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Main-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Main-Regular.ttf -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Main-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Main-Regular.woff -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Math-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Math-Italic.woff -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Math-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Math-Italic.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Size1-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Size1-Regular.ttf -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Size2-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Size2-Regular.ttf -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Size3-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Size3-Regular.ttf -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Size4-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Size4-Regular.ttf -------------------------------------------------------------------------------- /website/themes/book/static/fonts/roboto-v19-latin-300italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/fonts/roboto-v19-latin-300italic.woff -------------------------------------------------------------------------------- /website/themes/book/static/fonts/roboto-v19-latin-300italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/fonts/roboto-v19-latin-300italic.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/fonts/roboto-v19-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/fonts/roboto-v19-latin-regular.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Caligraphic-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Caligraphic-Bold.ttf -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Fraktur-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Fraktur-Bold.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Fraktur-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Fraktur-Regular.ttf -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Fraktur-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Fraktur-Regular.woff -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Main-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Main-BoldItalic.ttf -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Main-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Main-BoldItalic.woff -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Main-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Main-Regular.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Math-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Math-BoldItalic.ttf -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Math-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Math-BoldItalic.woff -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_SansSerif-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_SansSerif-Bold.ttf -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_SansSerif-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_SansSerif-Bold.woff -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_SansSerif-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_SansSerif-Bold.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_SansSerif-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_SansSerif-Italic.ttf -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Script-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Script-Regular.ttf -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Script-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Script-Regular.woff -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Script-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Script-Regular.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Size1-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Size1-Regular.woff -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Size1-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Size1-Regular.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Size2-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Size2-Regular.woff -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Size2-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Size2-Regular.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Size3-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Size3-Regular.woff -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Size3-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Size3-Regular.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Size4-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Size4-Regular.woff -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Size4-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Size4-Regular.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/fonts/roboto-mono-v6-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/fonts/roboto-mono-v6-latin-regular.woff -------------------------------------------------------------------------------- /website/themes/book/static/fonts/roboto-mono-v6-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/fonts/roboto-mono-v6-latin-regular.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Caligraphic-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Caligraphic-Bold.woff -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Caligraphic-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Caligraphic-Bold.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Fraktur-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Fraktur-Regular.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Main-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Main-BoldItalic.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Math-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Math-BoldItalic.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_SansSerif-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_SansSerif-Italic.woff -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_SansSerif-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_SansSerif-Italic.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_SansSerif-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_SansSerif-Regular.ttf -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_SansSerif-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_SansSerif-Regular.woff -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Typewriter-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Typewriter-Regular.ttf -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Caligraphic-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Caligraphic-Regular.ttf -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Caligraphic-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Caligraphic-Regular.woff -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Caligraphic-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Caligraphic-Regular.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_SansSerif-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_SansSerif-Regular.woff2 -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Typewriter-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Typewriter-Regular.woff -------------------------------------------------------------------------------- /website/themes/book/static/katex/fonts/KaTeX_Typewriter-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ysluckly/leetcode/HEAD/website/themes/book/static/katex/fonts/KaTeX_Typewriter-Regular.woff2 -------------------------------------------------------------------------------- /website/content/ChapterTwo/Binary_Indexed_Tree.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Binary Indexed Tree 3 | type: docs 4 | --- 5 | 6 | # Binary Indexed Tree 7 | 8 |  9 | -------------------------------------------------------------------------------- /leetcode/0172.Factorial-Trailing-Zeroes/172. Factorial Trailing Zeroes.go: -------------------------------------------------------------------------------- 1 | package leetcode 2 | 3 | func trailingZeroes(n int) int { 4 | if n/5 == 0 { 5 | return 0 6 | } 7 | return n/5 + trailingZeroes(n/5) 8 | } 9 | -------------------------------------------------------------------------------- /leetcode/0344.Reverse-String/344. Reverse String.go: -------------------------------------------------------------------------------- 1 | package leetcode 2 | 3 | func reverseString(s []byte) { 4 | for i, j := 0, len(s)-1; i < j; { 5 | s[i], s[j] = s[j], s[i] 6 | i++ 7 | j-- 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /leetcode/1108.Defanging-an-IP-Address/1108. Defanging an IP Address.go: -------------------------------------------------------------------------------- 1 | package leetcode 2 | 3 | import "strings" 4 | 5 | func defangIPaddr(address string) string { 6 | return strings.Replace(address, ".", "[.]", -1) 7 | } 8 | -------------------------------------------------------------------------------- /website/themes/book/layouts/_default/_markup/render-heading.html: -------------------------------------------------------------------------------- 1 |
9 |
10 |
8 | {{- .Content -}} 9 |
10 |
9 |
10 |
13 | {{- .Inner -}} 14 |
15 | -------------------------------------------------------------------------------- /website/themes/book/layouts/shortcodes/tab.html: -------------------------------------------------------------------------------- 1 | {{ if .Parent }} 2 | {{ $name := .Get 0 }} 3 | {{ $group := printf "tabs-%s" (.Parent.Get 0) }} 4 | 5 | {{ if not (.Parent.Scratch.Get $group) }} 6 | {{ .Parent.Scratch.Set $group slice }} 7 | {{ end }} 8 | 9 | {{ .Parent.Scratch.Add $group (dict "Name" $name "Content" .Inner) }} 10 | {{ else }} 11 | {{ errorf "%q: 'tab' shortcode must be inside 'tabs' shortcode" .Page.Path }} 12 | {{ end}} 13 | -------------------------------------------------------------------------------- /leetcode/0448.Find-All-Numbers-Disappeared-in-an-Array/448. Find All Numbers Disappeared in an Array.go: -------------------------------------------------------------------------------- 1 | package leetcode 2 | 3 | func findDisappearedNumbers(nums []int) []int { 4 | res := []int{} 5 | for _, v := range nums { 6 | if v < 0 { 7 | v = -v 8 | } 9 | if nums[v-1] > 0 { 10 | nums[v-1] = -nums[v-1] 11 | } 12 | } 13 | for i, v := range nums { 14 | if v > 0 { 15 | res = append(res, i+1) 16 | } 17 | } 18 | return res 19 | } 20 | -------------------------------------------------------------------------------- /website/themes/book/static/svg/translate.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /leetcode/0118.Pascals-Triangle/118. Pascal's Triangle.go: -------------------------------------------------------------------------------- 1 | package leetcode 2 | 3 | func generate(numRows int) [][]int { 4 | result := [][]int{} 5 | for i := 0; i < numRows; i++ { 6 | row := []int{} 7 | for j := 0; j < i+1; j++ { 8 | if j == 0 || j == i { 9 | row = append(row, 1) 10 | } else if i > 1 { 11 | row = append(row, result[i-1][j-1]+result[i-1][j]) 12 | } 13 | } 14 | result = append(result, row) 15 | } 16 | return result 17 | } 18 | -------------------------------------------------------------------------------- /leetcode/0343.Integer-Break/343. Integer Break.go: -------------------------------------------------------------------------------- 1 | package leetcode 2 | 3 | func integerBreak(n int) int { 4 | dp := make([]int, n+1) 5 | dp[0], dp[1] = 1, 1 6 | for i := 1; i <= n; i++ { 7 | for j := 1; j < i; j++ { 8 | // dp[i] = max(dp[i], j * (i - j), j*dp[i-j]) 9 | dp[i] = max(dp[i], j*max(dp[i-j], i-j)) 10 | } 11 | } 12 | return dp[n] 13 | } 14 | 15 | func max(a int, b int) int { 16 | if a > b { 17 | return a 18 | } 19 | return b 20 | } 21 | -------------------------------------------------------------------------------- /leetcode/0724.Find-Pivot-Index/724. Find Pivot Index.go: -------------------------------------------------------------------------------- 1 | package leetcode 2 | 3 | // 2 * leftSum + num[i] = sum 4 | // 时间: O(n) 5 | // 空间: O(1) 6 | func pivotIndex(nums []int) int { 7 | if len(nums) <= 0 { 8 | return -1 9 | } 10 | var sum, leftSum int 11 | for _, num := range nums { 12 | sum += num 13 | } 14 | for index, num := range nums { 15 | if leftSum*2+num == sum { 16 | return index 17 | } 18 | leftSum += num 19 | } 20 | return -1 21 | } 22 | -------------------------------------------------------------------------------- /leetcode/1005.Maximize-Sum-Of-Array-After-K-Negations/1005. Maximize Sum Of Array After K Negations.go: -------------------------------------------------------------------------------- 1 | package leetcode 2 | 3 | import ( 4 | "sort" 5 | ) 6 | 7 | func largestSumAfterKNegations(A []int, K int) int { 8 | sort.Ints(A) 9 | minIdx := 0 10 | for i := 0; i < K; i++ { 11 | A[minIdx] = -A[minIdx] 12 | if A[minIdx+1] < A[minIdx] { 13 | minIdx++ 14 | } 15 | } 16 | sum := 0 17 | for _, a := range A { 18 | sum += a 19 | } 20 | return sum 21 | } 22 | -------------------------------------------------------------------------------- /website/themes/book/i18n/ko.yaml: -------------------------------------------------------------------------------- 1 | - id: Search 2 | translation: Search 3 | 4 | - id: Edit this page 5 | translation: Edit this page 6 | 7 | - id: Last modified by 8 | translation: Last modified by 9 | 10 | - id: Expand 11 | translation: Expand 12 | 13 | - id: bookSearchConfig 14 | translation: | 15 | { 16 | encode: false, 17 | tokenize: function(str) { 18 | return str.replace(/[\x00-\x7F]/g, '').split(''); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /leetcode/0021.Merge-Two-Sorted-Lists/README.md: -------------------------------------------------------------------------------- 1 | # [21. Merge Two Sorted Lists](https://leetcode.com/problems/merge-two-sorted-lists/) 2 | 3 | ## 题目 4 | 5 | Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 6 | 7 | Example : 8 | 9 | ``` 10 | Input: 1->2->4, 1->3->4 11 | Output: 1->1->2->3->4->4 12 | 13 | ``` 14 | 15 | ## 题目大意 16 | 17 | 合并 2 个有序链表 18 | 19 | ## 解题思路 20 | 21 | 按照题意做即可。 -------------------------------------------------------------------------------- /leetcode/0055.Jump-Game/55. Jump Game.go: -------------------------------------------------------------------------------- 1 | package leetcode 2 | 3 | func canJump(nums []int) bool { 4 | n := len(nums) 5 | if n == 0 { 6 | return false 7 | } 8 | if n == 1 { 9 | return true 10 | } 11 | maxJump := 0 12 | for i, v := range nums { 13 | if i > maxJump { 14 | return false 15 | } 16 | maxJump = max(maxJump, i+v) 17 | } 18 | return true 19 | } 20 | 21 | func max(a int, b int) int { 22 | if a > b { 23 | return a 24 | } 25 | return b 26 | } 27 | -------------------------------------------------------------------------------- /leetcode/0062.Unique-Paths/62. Unique Paths.go: -------------------------------------------------------------------------------- 1 | package leetcode 2 | 3 | func uniquePaths(m int, n int) int { 4 | dp := make([][]int, n) 5 | for i := 0; i < n; i++ { 6 | dp[i] = make([]int, m) 7 | } 8 | for i := 0; i < m; i++ { 9 | dp[0][i] = 1 10 | } 11 | for i := 0; i < n; i++ { 12 | dp[i][0] = 1 13 | } 14 | for i := 1; i < n; i++ { 15 | for j := 1; j < m; j++ { 16 | dp[i][j] = dp[i-1][j] + dp[i][j-1] 17 | } 18 | } 19 | return dp[n-1][m-1] 20 | } 21 | -------------------------------------------------------------------------------- /website/themes/book/layouts/partials/docs/title.html: -------------------------------------------------------------------------------- 1 | 5 | {{ $title := "" }} 6 | 7 | {{ if .Title }} 8 | {{ $title = .Title }} 9 | {{ else if and .IsSection .File }} 10 | {{ $title = path.Base .File.Dir | humanize | title }} 11 | {{ else if and .IsPage .File }} 12 | {{ $title = .File.BaseFileName | humanize | title }} 13 | {{ end }} 14 | 15 | {{ return $title }} 16 | -------------------------------------------------------------------------------- /leetcode/0066.Plus-One/66. Plus One.go: -------------------------------------------------------------------------------- 1 | package leetcode 2 | 3 | func plusOne(digits []int) []int { 4 | if len(digits) == 0 { 5 | return []int{} 6 | } 7 | carry := 1 8 | for i := len(digits) - 1; i >= 0; i-- { 9 | if digits[i]+carry > 9 { 10 | digits[i] = 0 11 | carry = 1 12 | } else { 13 | digits[i] += carry 14 | carry = 0 15 | } 16 | } 17 | if digits[0] == 0 && carry == 1 { 18 | digits = append([]int{1}, digits...) 19 | } 20 | return digits 21 | } 22 | -------------------------------------------------------------------------------- /leetcode/0204.Count-Primes/README.md: -------------------------------------------------------------------------------- 1 | # [204. Count Primes](https://leetcode.com/problems/count-primes/) 2 | 3 | 4 | ## 题目 5 | 6 | Count the number of prime numbers less than a non-negative number, **n**. 7 | 8 | **Example:** 9 | 10 | Input: 10 11 | Output: 4 12 | Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7. 13 | 14 | 15 | ## 题目大意 16 | 17 | 统计所有小于非负整数 n 的质数的数量。 18 | 19 | 20 | ## 解题思路 21 | 22 | - 给出一个数字 n,要求输出小于 n 的所有素数的个数总和。简单题。 23 | -------------------------------------------------------------------------------- /leetcode/0720.Longest-Word-in-Dictionary/720. Longest Word in Dictionary.go: -------------------------------------------------------------------------------- 1 | package leetcode 2 | 3 | import ( 4 | "sort" 5 | ) 6 | 7 | func longestWord(words []string) string { 8 | sort.Strings(words) 9 | mp := make(map[string]bool) 10 | var res string 11 | for _, word := range words { 12 | size := len(word) 13 | if size == 1 || mp[word[:size-1]] { 14 | if size > len(res) { 15 | res = word 16 | } 17 | mp[word] = true 18 | } 19 | } 20 | return res 21 | } 22 | -------------------------------------------------------------------------------- /leetcode/1078.Occurrences-After-Bigram/1078. Occurrences After Bigram.go: -------------------------------------------------------------------------------- 1 | package leetcode 2 | 3 | import "strings" 4 | 5 | func findOcurrences(text string, first string, second string) []string { 6 | var res []string 7 | words := strings.Split(text, " ") 8 | if len(words) < 3 { 9 | return []string{} 10 | } 11 | for i := 2; i < len(words); i++ { 12 | if words[i-2] == first && words[i-1] == second { 13 | res = append(res, words[i]) 14 | } 15 | } 16 | return res 17 | } 18 | -------------------------------------------------------------------------------- /leetcode/0884.Uncommon-Words-from-Two-Sentences/884. Uncommon Words from Two Sentences.go: -------------------------------------------------------------------------------- 1 | package leetcode 2 | 3 | import "strings" 4 | 5 | func uncommonFromSentences(A string, B string) []string { 6 | m, res := map[string]int{}, []string{} 7 | for _, s := range []string{A, B} { 8 | for _, word := range strings.Split(s, " ") { 9 | m[word]++ 10 | } 11 | } 12 | for key := range m { 13 | if m[key] == 1 { 14 | res = append(res, key) 15 | } 16 | } 17 | return res 18 | } 19 | -------------------------------------------------------------------------------- /leetcode/0973.K-Closest-Points-to-Origin/973. K Closest Points to Origin.go: -------------------------------------------------------------------------------- 1 | package leetcode 2 | 3 | import "sort" 4 | 5 | // KClosest define 6 | func KClosest(points [][]int, K int) [][]int { 7 | sort.Slice(points, func(i, j int) bool { 8 | return points[i][0]*points[i][0]+points[i][1]*points[i][1] < 9 | points[j][0]*points[j][0]+points[j][1]*points[j][1] 10 | }) 11 | ans := make([][]int, K) 12 | for i := 0; i < K; i++ { 13 | ans[i] = points[i] 14 | } 15 | return ans 16 | } 17 | -------------------------------------------------------------------------------- /leetcode/0981.Time-Based-Key-Value-Store/981. Time Based Key-Value Store_test.go: -------------------------------------------------------------------------------- 1 | package leetcode 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | ) 7 | 8 | func Test_Problem981(t *testing.T) { 9 | obj := Constructor981() 10 | obj.Set("foo", "bar", 1) 11 | fmt.Printf("Get = %v\n", obj.Get("foo", 1)) 12 | fmt.Printf("Get = %v\n", obj.Get("foo", 3)) 13 | obj.Set("foo", "bar2", 4) 14 | fmt.Printf("Get = %v\n", obj.Get("foo", 4)) 15 | fmt.Printf("Get = %v\n", obj.Get("foo", 5)) 16 | } 17 | -------------------------------------------------------------------------------- /website/themes/book/layouts/partials/docs/post-meta.html: -------------------------------------------------------------------------------- 1 | {{ with .Date}} 2 |9 | {{- .Summary -}} 10 | {{ if .Truncated }} 11 | ... 12 | {{ end }} 13 |
14 |9 | {{- .Summary -}} 10 | {{ if .Truncated }} 11 | ... 12 | {{ end }} 13 |
14 |