| # | User | Rating |
|---|---|---|
| 1 | Benq | 3857 |
| 2 | jiangly | 3810 |
| 3 | maroonrk | 3534 |
| 4 | tourist | 3528 |
| 5 | Kevin114514 | 3510 |
| 6 | turmax | 3411 |
| 7 | Um_nik | 3387 |
| 8 | Radewoosh | 3367 |
| 9 | heuristica | 3322 |
| 10 | strapple | 3317 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 157 |
| 2 | maspy | 150 |
| 3 | Um_nik | 145 |
| 4 | Errichto | 139 |
| 5 | adamant | 136 |
| 6 | maroonrk | 134 |
| 7 | DNR | 133 |
| 7 | nik_exists | 133 |
| 9 | AmShZ | 130 |
| 10 | Dominater069 | 129 |
|
0
Yes but I am sometimes not even able to understand the solution. Who should I ask in these cases and where? Thanks |
|
0
But my question is with this DP approach we are only considering:
|
|
0
Yes, sorry about that |
|
-11
Thanks, but I am really struggling with this problem because of multiplication and division mixed with add/sub. Can you help me here? |
|
0
For this test case The order of division is to be from the right to the left, and while just switching Any way to get around it? |
|
0
I was hoping to know the stack solution. |
|
0
Got it using help and skimming over solution What an amazing problem. Since I did not get it from this website, how difficult would this be on here? Div1-C? |
|
0
Ah dammit, you finding this "straightforward," is pretty dis-heartening. I'm kind of disappointed I couldn't come up with this. How do you come up with solutions like this? Ie, how did you think of this? |
|
+5
Thanks! Can you explain this part: "However, if no element of A is bigger than the biggest element of B, you should just use your lowest element, so that you won't "waste" your bigger elements." ? I don't understand how you came up with this or why its true. Thanks |
|
0
Thanks! And what is your technique to come up with greedy strategy? I am working on this: My blog post For this one for example I can't come up with a greedy strategy. How do you think of one for arrays like this for example? |
|
0
Can you give your recommendation? You seem experienced, any advice is appreciated! |
|
-8
Does anyone have good resources that helped them with Greedy and finding patterns for Greedy problems? Thanks |
|
0
Ah I see. So basically what you are saying is, for problems involving Greedy the best (without proof and during contest) I can do is guess a strategy using test cases and pray that it works? How exactly do guess the strategy? Is it just trying to draw patterns from examples? Any concrete techniques for that? |
|
0
Hey! Ok I am starting to understand it, please tell me if this is correct: By subsequence below I mean palindromic subsequence
Then since you counted twice:
So that's why I don't do Final sum is:
Is this accurate? |
|
0
Hi, I am not sure I understand why that is the case, please help me here. If I am doing: The 1 means the palin. subsequence "S[L]S[R]" (just 2 letters) The The But both of these will cover palin. subseq from So why shouldn't I subtract Thanks! |
|
0
Can you explain why the greedy strategy works for the case with no zeros? I was thinking of removing largest digit in every iteration, O(N^2) time, it seems yours is O(N) |
|
0
Can you help me with DFS approach in O(N)? I am very confused how to do it. Thank you so much |
|
0
Can you help me out with this DFS approach? I am trying to understand it properly. Say I do a DFS from Node X to all of its children, then if denote: DP[x][some child] = DP[some child][x] = distance from X to some Child, which ever child we are looking at. Are you saying I should then use DP[x][some child] for parents of node X? Thanks! |
|
0
Hi, I am not sure I understand your hint. If I know the sum of distances node X to node Y I am not sure how this helps? Thanks! |
|
0
I've solved it already, the optimization was just a 2d memo :( anyway, constraint was ring.length() <= 100 key.length() <= 45 |
|
0
Hey there, Thanks for the reply and solution. Would you be willing to share why you thought of these things so I can get an idea of your thought process and apply it to future problems? Thanks |
|
0
It turns out there is an O(N) solution, can anyone give some hints for that? |
|
0
How about the case with negative numbers? If there were no zeros (and only positive numbers) I would basically cut everytime I got (SUM_OF_ARRAY/3). But with {-1, +1} somewhere there this will make things tricky. |
|
0
Amazing explanation, thank you so much! |
|
0
Hi there, "If some subarray has sum equals to X, it means that if you flip this subarray, you get X 1's more than your initial answer. So, with this information, the answer is related with the maximum subarray sum you can get." Can you please explain why this is the case? Thank you very much |
|
0
Auto comment: topic has been updated by aakarshmadhavan (previous revision, new revision, compare). |
|
0
Can someone please help out with Problem C? Thanks! I don't see a way to start. The tag said "SORTING," but I am not sure how to even apply it here. |
|
+3
Chill bro lol. |
|
+3
I have a question. Let's say I give up in 2-3 hours and look at the solution, what am I supposed to learn? For example, sometimes I'll read the solution, think I've understood the technique then fail some other similar problem. In other words, how do you learn the fundamentals/techniques underlying in the problem that you can apply to other problems later on? |
|
0
Hey there, Thanks for the reply. I'm actually trying to learn how to approach these types of problems. I have done several DP problems on Leetcode OJ, and they are often I am not sure how you came up with your idea of: Can you please explain your thought process here? Thanks very much. |
|
0
Hi there, Thanks for the reply. I implemented this solution, but it is a slow solution. Apparently there is a faster DP state for this than using LCS. Any ideas on how to approach that? I am unable to figure it out. Here is the actual problem: https://leetcode.com/problems/minimum-window-subsequence/description/ Thanks |
|
+4
Amazing sheet for those under 1700 such as myself looking to crack interviews and slowly get ot blue rating. Thanks! |
|
0
Hey there! I am also very stuck on this problem and your solution is not making sense to me. I have some questions, hope you will answer. -- If C[ a[] % m ] is full, how do you decide the next bucket in the container? Why do you add a[i] number of steps? -- At the end how do you track what the final array is? Thanks |
|
+1
Hello! Can someone help me with Problem D? I saw the comment, but I do not understand it. Will appreciate if someone can explain the idea and how you reached it. For Problem D, I did a BFS from the initial array until one array suceeds. This I feel is correct, but I had a memory limit exceeded within test 5. Thanks |
| Name |
|---|


