Grind75

Grind75

task id: grind75

2024-09-26 09:33: Grind75 #grind75 #timelog:01:25:41

Tasking this out now, as well as timing it.

542, 973

2024-09-27 13:41: Grind75 #grind75 #timelog:01:41:23

2024-09-27 16:47: 3summing research #grind75 #timelog:00:47:50

What's tough here is the acceptance criteria. It needs to be 3 unique indices and the combination itself needs to be unique. Having the nested 3-loop is cleaner because the variables are in scope. Doing it with the backtracking approach requires cramming data in the recursive function.

dead end. Moving on

2024-09-27 17:17: 3sum: looking at the editorial #grind75

The loops are moved around and hidden, but there still seems to be 3 distinct loops. The thing that's interesting (ish) here is that they are treating the problem as an extension of twosum, and re-using that logic, calling a version of twosum inside of 3sum.

2024-09-27 17:25: wait wikipedia has a whole page on 3sum #grind75

I like their algorithm, which looks the two-pointer in the editorial.

2024-09-30 09:25: Grind75 #grind75 #timelog:01:30:00

2024-10-01 11:01: Grind75 #grind75 #timelog:01:08:04

I hate when people talk in the library. I can't focus.

This graph problem isn't clicking for me yet (LC 207). Grr. Taking a break.

2024-10-01 13:20: Grind75-ing #grind75 #timelog:01:50:13

2024-10-02 09:49: Grind75 #grind75 #timelog:01:03:30

Attempting that coin change problem again, among other things.

2024-10-03 13:00: Grind75 #grind75 #timelog:01:33:13

Per the recommendation of several people, I am going to just the Leetcode website to write code. It has the verification and eveything, and will help me pick up on weird edge cases.

2024-10-05 10:17: Grind75 #grind75 #timelog:01:23:34

39 (combination sum) is a backtracking problem that I am not understanding properly.

2024-10-05 14:53: The grind continues. #grind75 #timelog:02:18:10

I did 46, poorly. 39 passed when I used a different data structure.

2024-10-06 10:02: Grind75 #grind75 #timelog:01:37:11

Uh oh, I've just been running locally. I've been forgetting to submit stuff. I knew things were feeling wrong.

56, 981

2024-10-06 12:46: Grind75 #grind75 #timelog:02:37:49

2024-10-06 17:14: See if I can re-implement 236 #grind75 #timelog:01:02:24

Even with the editorial in my face, it still took me an hour to implement. jeez.

2024-10-21 09:25: Grind75 #grind75 #timelog:01:44:04

2024-10-22 10:20: Grind75 #grind75 #timelog:00:30:00

Pen and paper

2024-10-22 11:14: Grind75 #grind75 #timelog:01:58:40

Coding it up

2024-10-22 12:56: Wow this is taking a while. Ugh. #grind75

2024-10-22 13:24: Finally. #grind75

Only took me 2.5 hours.

2024-10-24 10:05: Grind75 #grind75 #timelog:02:02:58

2024-10-25 11:26: Grind75 #grind75 #timelog:00:21:58

2024-10-25 14:24: Grind75 #grind75 #timelog:01:38:51

2024-10-26 09:26: Grind75 #grind75 #timelog:01:07:57

2024-10-26 15:42: Grind75 #grind75 #timelog:01:11:09

2024-10-26 18:35: Grind75 #grind75 #timelog:00:20:40

2024-10-28 10:52: Grind75 #grind75 #timelog:01:01:11

2024-10-28 14:32: Grind75 #grind75 #timelog:01:08:29

2024-10-28 20:17: Grind75 #grind75 #timelog:00:03:57

2024-11-01 08:05: Grind75 #grind75 #timelog:00:24:30

2024-11-01 19:37: Grind75 #grind75 #timelog:00:12:36

2024-11-05 10:03: Grind75 #grind75 #timelog:01:20:00

2024-11-06 11:58: Grind75-ing #grind75 #timelog:00:19:18

Just want to get that last problem working (LC 310: minimum height trees)

2024-11-11 10:38: Grind75 #grind75 #timelog:01:03:56

I'm trying to grok this findMinHeightTrees problem better. Also, LC 739 (Daily Temperatures)

2024-11-12 09:45: Grind75 #grind75 #timelog:00:24:40

198: House Robber

2024-11-12 10:37: Grind75 #grind75 #timelog:00:40:00

134: Gas Station

2024-11-12 12:53: Grind75 #grind75 #timelog:00:39:44

134: Gas Station (Continued) #grind75

2024-11-12 14:26: Grind75 #grind75 #timelog:00:41:26

More Gas Station (134)

2024-11-12 17:35: Grind75 #grind75 #timelog:00:58:25

Gas Station, again (134). I thought it was dynamic programming. It was not. Another day wasted. I will have to look at this: https://www.youtube.com/watch?v=lJwbPZGo05A.

2024-11-13 09:33: Grind75 #grind75 #timelog:00:15:00

Watching the neetcode video.

2024-11-13 10:48: Grind75 #grind75 #timelog:00:41:52

36: Valid Sudoku

2024-11-13 12:34: Grind75 #grind75 #timelog:00:13:00

49: Group anagrams

2024-11-13 12:49: 152: Maximum Product Subarray #grind75 #timelog:00:51:16

152: maximum product subarray

2024-11-14 10:31: Grind75 #grind75 #timelog:01:27:44

211: Design and Search Words Data Structure. I think it's a Trie problem. Spent most of this time just getting the Trie structure the way I imagined it. Have not implemented the search yet, which I believe will be a DFS using a stack (for backtracking when a '.' is encountered).

2024-11-14 12:56: 211 continued #grind75 #timelog:01:12:21

Ran out of time. Right data struture (trie), but my search doesn't work properly ('..' is a problem on the huge edge case).

2024-11-14 14:23: wait wait, one idea to try. #grind75 #timelog:00:28:15

I'm breaking out too early.

Nevermind. I'm not getting it right. Time to stop.

2024-11-15 10:32: Read up on 211 #grind75 #timelog:01:18:31

Ah. I was not making a Trie in my original implementation. I only kept track of possible combinations for each position, which was more efficience memory-wise, but it did not keep track of paths between unique words.

Example: "dig" and "dog" show up as (d (o (g)) (i (g))) There are two g's here. My structure represented the set as ([d], [o i], [g]).

If I were to add "mop" to the the structure. A trie would look like: ((m (o (p)) (d (o (g)) (i (g)))) My structure would look like: ([m d] [o i] [g p]) There's no way to tell if "mip" is a valid path or not

Even with pointers, "mog" could be valid with this path. ([m:[o] d:[o i]] [o:[g p] i:[g]] [g p])

2024-11-15 16:55: Grind75 #grind75 #timelog:01:07:04

417: Pacific Island Water Problem. I think I am close. It seems to lend itself well to a dynamic programming problem, but I turned up an edge case where I wasn't checking in all the available directions. Will look into that later.

2024-11-16 08:53: Finishing up LC417 #grind75 #timelog:00:41:32

I'm hoping I just need to code up an edge case and that my overall solution is solid.

2024-11-16 09:06: LC417: They wanted you to use BFS or DFS, not dynamic programming #grind75

My edge case isn't working.

2024-11-16 09:14: I just bought a year of premium. #grind75

If I do 6 months, it'll be cheaper than the monthly rate.

2024-11-16 09:36: Onto LC19 #grind75 #timelog:00:28:14

Remove Nth node from linked list

2024-11-16 10:55: LC1730 #grind75 #timelog:00:19:54

Shortest path to get food. Note that the time here is for implementation. Took me about 3-5 extra minutes to get the implementation, but I casually timed that one.

2024-11-16 11:24: LC287 #grind75 #timelog:00:35:21

Find the duplicate number. Did brute force, then looked up the answer.

2024-11-17 09:37: 692: top K frequent words #grind75 #timelog:00:31:54

Lexicographic order threw me off. It turns out the built-in structures in Python used to solve this problem (Counter, heapify) seem to handle this for you already? Was I supposed to know that?

Follow-up problem 347 Top K frequent elements. Apparently this follows a similar pattern: https://leetcode.com/problems/top-k-frequent-elements/description/

2024-11-17 14:57: LC53: Maximum Subarray #grind75 #timelog:00:25:16

I did this already I think. But I didn't submit it, so it's a redo now.

Note to self: a subarray is different from a subsequence. Subarrays are continguous.

Wow, I did not get this right the first time. I gave up early and looked at the answer.

2024-11-17 15:30: I have to redo the first 3 weeks #grind75

I didn't submit. So, I didn't really learn anything. yay.

2024-11-17 15:31: LC57: Insert Interval #grind75 #timelog:01:18:50

Got something working, but I want to review this tomorrow

2024-11-18 11:48: LC 542. 01 Matrix #grind75 #timelog:00:13:30

2024-11-18 12:05: LC 973. K Closest Points To Origin #grind75 #timelog:00:09:45

2024-11-18 12:21: LC 3. Longest substring without repeating characters #grind75 #timelog:00:24:19

2024-11-18 12:53: LC 15: 3sum #grind75 #timelog:00:42:44

2024-11-19 09:47: LC102: Binary Tree Level Order Traversal #grind75 #timelog:00:26:02

2024-11-19 10:21: LC133: Clone Graph #grind75 #timelog:00:31:28

2024-11-19 11:30: LC150: Evaluate Reverse Polish Notation #grind75 #timelog:00:34:10

2024-11-20 09:36: 207: Course Schedule #grind75 #timelog:01:15:13

2024-11-20 12:56: 208: Implement Trie #grind75 #timelog:00:06:32

2024-11-21 09:29: 322: Coin Change #grind75 #timelog:01:55:22

2024-11-21 10:24: Coin change editorial and research #grind75

2024-11-21 12:43: LC238: Product of Array Except Self #grind75 #timelog:00:21:19

2024-11-21 13:11: LC238 Editorial and Research #grind75 #timelog:00:16:37

2024-11-21 13:33: LC155: Min Stack #grind75 #timelog:00:06:54

2024-11-21 13:40: LC155 Editorial and Research #grind75 #timelog:00:09:30

2024-11-22 09:17: LC89: validate binary search tree #grind75 #timelog:00:59:02

Initial attmpts. Program hit edge cases quickly.

2024-11-22 15:08: LC200: Number of islands #grind75 #timelog:00:37:44

2024-11-22 15:48: LC200 Continued #grind75 #timelog:00:41:33

2024-11-22 16:30: LC200 Editorial and Research #grind75 #timelog:00:38:45

I was close to getting BFS right. I didn't think to simply erase islands as I went.

2024-11-22 17:11: LC994: Rotting Oranges #grind75 #timelog:00:30:56