log: LeetCode 60 problems to solve
競技プログラミングのわからなかった問題
コーディング面接対策のために解きたいLeetCode 60問 | 新井康平
60 questions to solve
Probablly I should solve easy problems first.
27 / 60
2024/03/03 - 2024/03/09
6 challenged
2024/03/03
6 challenged
2024/2/18 - 2024/03/02
2 challenged
2024/03/02
2 problems challenged
2024/02/11 - 2024/02/17
49 problems remain
Goal
Challenge 7 problems
Progress
8 question challended
2024/02/17
1 challenged
Q Unique email Addresses
2024/02/13
2 question was challenged
Q Kth Largest Number
Q Move Zeros
2024/02/12
2 question was solved
Q Best Time to Buy and Sell Stock
Q Reverse Linked List
2024/02/11
3 question was solved
Q Maximum Depth of Binary Tree
Q Convert Sorted Array to Binary Search Tree
Q Minimum Depth of Binary Tree
2024/02/04 - 2024/02/10
Goal
7 questions challenged
Achievement
11 questions challenged
+ 4 questions
2024/02/09
Q Remove Duplicates from Sorted List
A yamakou answer
Q Search Insert Position
It's like binary search but I have to care about corner case so I was stacked manytimes
solution 4295551
This solution is simple but I don't get why this works well every case🤔
2024/02/08
Q Search in Rotated Sorted Array
Q Next Permutation
retired but I am came up with good idea.
It's good to separate case when input is max, min, or something else but I can not came up with proper solution for else case
That is hard to came up with an idea to solve this.
2024/02/07
Q Generate Parentheses
retired
I can't came up with correct solution
easy solution
2024/02/06
Q valid-parenthesis
A https://leetcode.com/problems/valid-parentheses/post-solution/?submissionId=1167606884
In the discussion, I found tips to use recursive tree.
Q String to Integer
A
Q Zigzag Conversion
A https://leetcode.com/problems/zigzag-conversion/submissions/1166969064?envType=list&envId=pq1hc5n7
2024/02/05
Q longest-substring-without-repeating-characters
Stack on bug and retire it
save data
https://leetcode.com/problems/longest-substring-without-repeating-characters/?envType=list&envId=pq1hc5n7
2024/02/04
Add two numbers
Q: add two numbers
A: rough-answer
memo
LeetCode: Ruby: ListNode
code:md
Input: l1 = 2,4,3, l2 = 5,6,4
Output: 7,0,8
Explanation: 342 + 465 = 807.
l1 and l2 is non-negative integers.
The digits stored in reversed order.
That would mean representing 402 as [2,0,4].
first thought:
Edgh case:
The length is not same. Consider add leading zeros
The solution what I came up at first is
Add leading zeros
Iterate list to add values
second thought:
I should not add leading zeros
because list is given as linked_list. The cost of counting list may be computationally expenxive
That is O(N).
two sum
Q: two sum
impression
I know that is good to use hash map for solving two sum problem so I can solve it with O(N) order.