That’s how I sorta feel, my new schedule and routine seems to be working out. I got ahead of work by Wednesday, and I’m not quite behind yet, but I think I could be doing better. I’m writing here at the gym, and don’t really feel like doing classwork here. Plus I found a farmer’s market a couple blocks away from me that apparently runs every Saturday.

**GYM:**

I did full-body weightlifting today. Not that different from last week, but I upped the weights by minor amounts. BUT, that’s not to say that doesn’t count, ‘cause the point of me staying in similar weights at this time is to workout my stabilizer muscles.

Starting Monday, I’m gonna sign up for more classes. Hopefully, I’m not like an ‘outcast’ or something.

**CODE:**

Here’s them two:

https://leetcode.com/problems/reverse-linked-list/

https://leetcode.com/problems/contains-duplicate/

Honestly, I was about to do a medium problem, which I’ve done before. But my mind was just not working today, and these problems did a pretty good job in practice and teaching me something new.

So that first one was a little annoying, trying to visualize the linked list with my tired head. I attempted the iterative solution, but couldn’t focus so I did the recursive solution (pretty sure I’ve done the iterative solution in the past though). Long story short, run-time was abysmal in the recursive solution. Looked at the top submissions, and there was the iterative solution I was trying to write up. As practice, I visualized what was going on, and coded it again myself. Maybe I’ll revisit this problem at a later date.

The second one was fun. It was easy to do, to be honest; go through the list, put the entries in a hash table, and if it turns out its already in the hash table, return the result immediately. At best, it’s constant time, at worst its linear. The best solution was another case in which people used the built-in library for Python. Notably, the set() function. What I have to do is to really practice in regards to thinking about problems in that way.

I also learned that the len() function is actually O(1) time in Python, since each data structure carries that data with them. Good to know, since I’ve been avoiding using the len() function a lot since I thought it might’ve been a linear runtime operation.

The more you know,

-F