Day-by-day coding progress listed below (mostly LeetCode, with some Coursera and HackerRank sprinkled in).
Personal Website
LeetCode Profile
HackerRank Profile
LeetCode Problem Counter: 123/200 (as of 6/12/19)
[x] Array and String
[x] Hash Table
[ ] Linked List
[ ] Queue and Stack
[ ] Binary Tree
[ ] Binary Search Tree
[ ] N-ary Tree
[ ] Trie
[ ] Recursion
[ ] Binary Search
[ ] Decision Tree
[x] 617. Merge Two Binary Trees
[x] 226. Invert Binary Tree
[x] 965. Univalued Binary Tree
Thoughts: I am not as familiar as I thought with Trees. I had to look at the solutions for each of the questions. I will implement and familiarize myself with the different traversals for trees (DFS, BFS, Preorder, Inorder, Postorder) and do more problems to get more comfortable with recursive and iterative approaches.
The key insight to Merge Two Binary Trees is ...
The key insight to Invert a Binary Tree is ...
The key insight to check if a Binary Tree is Univalued is ...
[x] 406. Queue Reconstruction by Height
Thoughts: The key insight to Queue Reconstruction by Height is to sort the initial list of lists, people
, by height descending and index ascending (via people = sorted(people, key=lambda x: (-x[0], x[1]))
. We then initialize a list
to house our result. Iterate over each p
in people
and insert p
at index p[1]
in list
.
[x] 234. Palindrome Linked List
[x] 448. Find All Numbers Disappeared in an Array
Thoughts: I did not find the optimal solution for 234 and 448 within the 20 minute time frame for each. I was able to write a working naive solution. Will return to this ... TODO.
[x] 144. Binary Tree Preorder Traversal
[x] 94. Binary Tree Inorder Traversal
[x] 145. Binary Tree Postorder Traversal
Thoughts: For binary trees, practice the three different traversal methods: pre-order, in-order, and post order. Implement the methods both recursively and iteratively and compare the differences between them.
[x] UCSD DS & A Coursera Specialization - Data Structures - Week 1
Thoughts: I struggled to get the tree height problem working. Will re-visit.
[x] Integer between 1 and 1000 with greatest steps to reach 1 based on the Collatz Conjecture
[x] 206. Reverse Linked List
[x] 538. Convert BST to Greater Tree
[x] 287. Find the Duplicate Number
[x] 347. Top K Frequent Elements
[x] UCSD DS & A Coursera Specialization - Data Structures - Week 2
[x] HackerRank - Solve Me First
[x] HackerRank - Simple Array Sum
[x] HackerRank - Compare the Triplets
[x] HackerRank - Let's Echo
[x] HackerRank - A Very Big Sum
[x] HackerRank - Diagonal Difference
[x] HackerRank - Plus Minus
[x] HackerRank - Staircase
[x] HackerRank - Mini-Max Sum
[x] HackerRank - Birthday Cake Candles
[x] HackerRank - Time Conversion
[x] HackerRank - Grading Students
[x] 724. Find Pivot Index
[x] 747. Largest Number At Least Twice of Others
[x] 66. Plus One
[x] 498. Diagonal Traverse
[x] 54. Spiral Matrix
[x] 67. Add Binary
[x] UCSD DS & A Coursera Specialization - Data Structures - Week 3, Lectures
[x] UCSD DS & A Coursera Specialization - Data Structures - Week 3, Problems
[x] 344. Reverse String
[x] 167. Two Sum II - Input array is sorted
[x] 485. Max Consecutive Ones
[x] 27. Remove Element
[x] 561. Array Partition I
[x] 500. Keyboard Row
[x] 151. Reverse Words in a String
[x] 557. Reverse Words in a String III
[x] 189. Rotate Array
[x] 119. Pascal's Triangle II
[x] 26. Remove Duplicates from Sorted Array
[x] 283. Move Zeroes
[x] 209. Minimum Size Subarray Sum
[x] UCSD DS & A Coursera Specialization - Data Structures - Week 4, Lectures
[x] 1029. Two City Scheduling
[x] 1030. Matrix Cells in Distance Order
[x] UCSD DS & A Coursera Specialization - Data Structures - Week 4, Problems
[x] 705. Design HashSet
[x] 706. Design HashMap
[x] 136. Single Number
[x] 217. Contains Duplicate
[x] 349. Intersection of Two Arrays
[x] 202. Happy Number
[x] 1. Two Sum
[x] 205. Isomorphic Strings
[x] 599. Minimum Index Sum of Two Lists
[x] 387. First Unique Character in a String
[x] 350. Intersection of Two Arrays II
[x] 219. Contains Duplicate II
[x] 359. Logger Rate Limiter
[x] 49. Group Anagrams
[x] 249. Group Shifted Strings
[x] 3. Longest Substring Without Repeating Characters
[x] UCSD DS & A Coursera Specialization - Binary Search Trees - Week 5, Lectures
[x] UCSD DS & A Coursera Specialization - Binary Search Trees - Week 5, Lectures
[x] 170. Two Sum III - Data structure design
[x] 771. Jewels and Stones
[x] 36. Valid Sudoku
[x] 652. Find Duplicate Subtrees
[x] 5051. Valid Boomerang
[x] 5050. Binary Search Tree to Greater Sum Tree
[x] UCSD DS & A Coursera Specialization - Binary Search Trees - Week 6, Lectures & Problems
[x] 454. 4Sum II
[x] 288. Unique Word Abbreviation
[x] 380. Insert Delete GetRandom O(1)
None
None
None
None
[x] 707. Design Linked List
[x] 142. Linked List Cycle II
[x] 160. Intersection of Two Linked Lists
[x] 19. Remove Nth Node From End of List
[x] 203. Remove Linked List Elements
[x] 234. Palindrome Linked List
None
[x] 430. Flatten a Multilevel Doubly Linked List
[x] 1050. Actors and Directors Who Cooperated At Least Three Times
[x] 176. Second Highest Salary
[x] 977. Squares of a Sorted Array
[x] 938. Range Sum of BST
[x] 760. Find Anagram Mappings
[x] 61. Rotate List
[x] 138. Copy List with Random Pointer
[x] 613. Shortest Distance in a Line
None
None
[x] 1068. Product Sales Analysis I
[x] 1069. Product Sales Analysis II
[x] 584. Find Customer Referee
[x] 586. Customer Placing the Largest Number of Orders
[x] 610. Triangle Judgement
[x] 577. Employee Bonus
[x] 607. Sales Person
[x] 183. Customers Who Never Order
[x] 619. Biggest Single Number
[x] 175. Combine Two Tables
[x] 176. Second Highest Salary
[x] 177. Nth Highest Salary
[x] 178. Rank Scores
[x] 185. Department Top Three Salaries
[x] 184. Department Highest Salary
None
None
None
[x] 708. Insert into a Cyclic Sorted List
None
[ ] [TBD]
[ ] [TBD]
[ ] 46. Permutations
[ ] 78. Subsets
[ ] 142. Linked List Cycle II
[ ] 92. Reverse Linked List II
[ ] 341. Flatten Nested List Iterator
[ ] 160. Intersection of Two Linked Lists
[ ] 621. Task Scheduler
[ ] 102. Binary Tree Level Order Traversal
[ ] 297. Serialize and Deserialize Binary Tree
[ ] 267. Palindrome Permutation II
[ ] 386. Lexicographical Numbers
[ ] 1031. Maximum Sum of Two Non-Overlapping Subarrays
[ ] 1032. Stream of Characters
[ ] 41. First Missing Positive
[ ] 5047. Minimum Score Triangulation of Polygon
[ ] 5049. Moving Stones Until Consecutive II
[ ] 114. Flatten Binary Tree to Linked List