DawnAve's repositories
-Leetcode-1758-Easy-Trick
My solution includes some trick. I used true and false to represent zeros and ones, and a string of bools to represent a bitstring. A quite interesting problem, check my solution for details
A-Parser-For-Lisp-With-RDP-and-TDP
It is a parser for Lisp language, I wrote it based on several syntactic categories. Basically, it will check about solid number/lower case letters, and the use of parentheses.
Excel-to-Plain-Text
A simple program turning an Excel to objects in python and print out results. This can only work for the specific car program, where the columns of the excel file fits the __init__ part.
Leetcode-1026-DFS-
A medium problem, but with surprise, I solved it right away. What a great day.
Leetcode-1207-Dictionray
Finally, here is an improved way to turn a list into a dictionary. The problem itself is not hard, but if you want to same some code and time, check out the new way^_^
Leetcode-1239-DFS-Backtrack-Recursion
A medium problem. The idea behind is not complex, we need to try every combination and give the maximum answer. The question is, how can we do that? My wrong solution went from the opposite way, which made it hard. So it is basically a DFS problem, check the detailed solution file!
Leetcode-1347-Medium-Dictionary
A medium question, it took me a while to figure out that I splited two appearance of "c" in the word "practice" in two categories. Overall, it requires some logics, I will consider it as among the medium in the medium problems
Leetcode-150-Stack-Polish-Notation
A medium problem, about using stack to evaluate polish notations. I know about the notation, so it is quite easy for me. Basically, we use a stack to 1. record the numbers; 2. pop out operands for operators for evaluation. The last remaining element is the answer
Leetcode-1704-Easy-Array
I got it wrong several times because I didn't read the questions carefully, but overall it is easy.
Leetcode-198-Medium-DP
It looks like we have started a DP week, and I hate that. As usual, here is a chatGPT link to some help: https://chat.openai.com/share/7b64bee9-7274-47cc-bde7-37e3578513bb Unfortunately, I wrote down the correct expression in the first minute or so and ignored that. Besides finding the dp pattern, the solution is easy
Leetcode-2149-Medium-Array
An intuitive solution, check out the picture and the .py solution, they should be quite easy to understand
Leetcode-232-Queue-Stack-Class
A classic queue problem, for someone who don't know how to implement a class, it might be hard. One thing to remember is __init__ here don't return anything. *By the way, in the leetcode solution channel, there are lots of AI generated content. It's hard to prove, but it is clearly by AIs, characterized by several abnormally complex line of code
Leetcode-2385-Medium-Tree-Queue
I was thinking about the right thing, but didn't come up with a correct answer. The solution is from lancertech6. I have seen something similar before, and I should have remember that...
Leetcode-2610-Dictionary
A medium problem, but if you know enough about dictionaries (in my solution), it is not hard. Basically, we put all values into a dictionary and iteratively use them to create new sub-arrays. If an element is depleted, we skip it.
Leetcode-279-Medium-DP
Another dp, we have gone into the leetcode dp season. For this one, the logic is quite classic, we find the base case, and figure out ways to fill the dp list. The problem is fancy, but the idea is traditional
Leetcode-2870-Medium-Dictionary
Check out the .py file for a detailed explanation about the use of dictionary and logics behind that. It is an interesting problem!
Leetcode-387-Easy-Dictionary
There are of course several ways to tangle this problem, in python 3.8, dictionaries became ordered, and it will be a lot easier. Here is a solution that doesn't use ordered dictionary.
Leetcode-446-DP-Hard
A hard problem, and dp made it harder. To see the full explanation of the solution, see the .py file, the annotation will explain everything, hopefully. Also, here is a ChatGPT link to an analysis about the problem, check it out if you need it!
Leetcode-645-Easy-Count
A easy problem, with 40% acceptance rate. I failed submitting due to the sequence of the returning list, but the biggest mistake I made is that I overthought the problem. My solution is provided, but an alternative EXTREMELY easy solution is also there, it's obvious that I did too much
Leetcode-70-Easy-DP
The most classic DP problem, there are lots of ways to solve it, but here the solution is a common way to solve DP problems
Leetcode-76-Hard-Sliding-Window
The hint is already giving enough info and logics, the hard pard here is how to set everything up correctly. In the solution from prodonik, we use a list and count to manage the conditions
Leetcode-872-Easy-Tree
It took me a while to think about how to do a dfs, I just suddenly forgot how to do it. After that, everything is just usual coding
Leetcode-907-Medium-Stack-DP
A medium problem, but with 30% acceptance rate. There are three solutions provided, all of them are correct, but the failed one runs too slow.
Leetcode-91-Medium-DP
Solution is from SimplyPocky. The problem is quite hard compared to other medium problems. Maybe it's because I didn't do dp for a long time, I didn't figure this out on my own this time. I tried recursion at first, but there are too many conditions to take into account, which makes it wrong.
Leetcode-931-Medium-DP-2D-Array
I failed again on setting up 2d arrays. I used num = [[0]*n]*n instead of the correct way. Since all rows will point to the same row, the answer will of course be wrong. I believe this is the second time this weird answer has been generated