LeetCode Practice
GoogleTest - link
If you are currently using the Windows platform, type a command like the following for environment setup:
%comspec% /k "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
- This command can be accessed from x64 Native Tools Command Prompt for VS xx.
$ cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
$ cmake --build build (or ninja)
$ cd build
$ ctest --output-on-failure
160. Intersection of Two Linked Lists
83. Remove Duplicates from Sorted List
234. Palindrome Linked List (Microsoft, Amazon, …)
225. Implement Stack using Queues
232. Implement Queue using Stacks
429. N-ary Tree Level Order Traversal
349. Intersection of Two Arrays
356. Line Reflection (LeetCode Premium)
138. Copy List with Random Pointer (Amazon, Facebook, …)
28. Find the Index of the First Occurrence in a String
459. Repeated Substring Pattern
701. Insert into a Binary Search Tree
106. Construct Binary Tree from Inorder and Postorder Traversal
105. Construct Binary Tree from Preorder and Inorder Traversal
94. Binary Tree Inorder Traversal
98. Validate Binary Search Tree
102. Binary Tree Level Order Traversal
104. Maximum Depth of Binary Tree
114. Flatten Binary Tree to Linked List
199. Binary Tree Right Side View
230. Kth Smallest Element in a BST
501. Find Mode in Binary Search Tree
366. Find Leaves of Binary Tree (LeetCode Premium)
1475. Final Prices With a Special Discount in a Shop
34. Find First and Last Position of Element in Sorted Array
33. Search in Rotated Sorted Array
912. Sort an Array -> Practice Quick Sort and Merge Sort
2. Add Two Numbers (Apple, Amazon, Microsoft, …)
695. Max Area of Island (Google, Facebook, …)
236. Lowest Common Ancestor of a Binary Tree
167. Two Sum II - Input Array Is Sorted
26. Remove Duplicates from Sorted Array
977. Squares of a Sorted Array
680. Valid Palindrome II (Facebook, …)
209. Minimum Size Subarray Sum
3. Longest Substring Without Repeating Characters
340. Longest Substring with At Most K Distinct Characters (LeetCode Premium)
713. Subarray Product Less Than K
238. Product of Array Except Self
209. Minimum Size Subarray Sum
2410. Maximum Matching of Players With Trainers
5. Longest Palindromic Substring