My place to flow and grow.
2024 December 5th
I am glad I was able to make a solution from my own intuition. from collections import deque # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self…
This is the last month of my goal toward 150 problems done by 2025. I'll have to pick up more than a few problems this weekend. I have 56 problems remaining. from collections import deque # Definition for a binary tree node. # class TreeNode: #…
2024 November 28th
Happy Thanksgiving! I am happy to have solved this without looking up a solution. However, I did have to review traversals. from collections import deque # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0…
2024 November 26th
This took me a few days although it's only a medium! It is important to remember Python is pass-by-reference. I spent a lot of time debugging because I didn't mirror changes between previous and next nodes when moving a node between them. I was…
2024 November 23rd
I had to read the comments to understand this problem. I didn't understand how they wanted the ordering until I read a few examples. # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self…
2024 November 21st
The trick for this one was tracking duplicates via the unique boolean and a pending variable. # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next…
2024 November 20th
Today I chose an easy problem since I had a late day at work and gym afterwards. from collections import deque # Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val…
2024 November 19th
I had difficulties with this problem with terminating completed lists. I was surprised that ChatGPT didn't give this simple solution, it suggested a large rework. I'll have to be mindful before implementing all of ChatGPT's suggestions. # Definitio…
2024 November 18th
I was able to reduce this time complexity from O(n) = 2n to O(n) = n by using a list for the elements to be reversed, and then only modifying those rather than stepping through all nodes while reversing. # Definition for singly-linked list…
2024 November 15th
This problem was tricky as I had to track Node references rather than the index given in the input. from collections import defaultdict """ # Definition for a Node. class Node: def __init__(self, x: int, next: 'Node' = None, random: 'Node' =…
2024 November 14th
Final stack problem for this practice set is a hard question. Took me an hour and a half to come up with this convoluted method. Parsing numbers character by character was my first mistake. class Solution: def calculate(self, s: str) -> int:…
2024 November 13th
Now I'm on to stacks. I had to rethink my strategy of going from right to left, to left to right. I was overcomplicating it. class Solution: def evalRPN(self, tokens: List[str]) -> int: stack = [] for token in tokens:…
2024 November 12th
This took me a long time to cover all cases. class Solution: def insert(self, intervals: List[List[int]], newInterval: List[int]) -> List[List[int]]: start, end = newInterval inserted = False res = [] for…
2024 November 11th
Now I'm onto intervals. This one merges all intersecting intervals and returns the distinct items. class Solution: def merge(self, intervals: List[List[int]]) -> List[List[int]]: res = [] intervals = sorted(intervals)…
2024 November 9th
Working on hashmap problems now. from collections import defaultdict class Solution: def groupAnagrams(self, strs: List[str]) -> List[List[str]]: indexToSortedWord = defaultdict(list) for i, word in enumerate(strs…
2024 November 6th
Final matrix problem, this one a bit special to me. My first repo in Github is for a Game of Life program in C++. I created it in 2011 as a science fair project. This method uses constant space by usind integer division and modulo operations. We use…
2024 November 5th
Working through more matrix problems today. I used a method where we transpose the matrix, then reverse the rows. This is memory efficient in space and locality. class Solution: def rotate(self, matrix: List[List[int]]) -> None: """…
2024 November 4th
Now, I am working on matrix problems. This is my initial greedy solution. class Solution: def isValidSudoku(self, board: List[List[str]]) -> bool: for row in board: rowVals = set() for column in row:…
2024 November 3rd
Last problem for this study set's sliding window problems. This is my initial greedy solution. It passes initial test cases, but fails longer inputs. class Solution: def minWindow(self, s: str, t: str) -> str: def containsT(substring):…
2024 November 2nd
Starting with a hard problem today. class Solution: def findSubstring(self, s: str, words: List[str]) -> List[int]: lenTotal = len(''.join(words)) perms = set() def permutations(head, tail): if not len(head):…
2024 November 1st
This took a while to solve. I completed it over two days, then I had the help of ChatGPT to analyze the complexity. I reviewed other answers and I didn't find simpler methods. class Solution: def fullJustify(self, words: List[str], maxWidth: int…
2024 October 31st
This was an easy problem. class Solution: def strStr(self, haystack: str, needle: str) -> int: for j in range(len(haystack)): if haystack[j:j + len(needle)] == needle: return j return -1 O(n) = n
2024 October 30th
This one took me about 15 minutes to come up with a solution. I then worked through it with this naive solution. class Solution: def convert(self, s: str, numRows: int) -> str: grid = [['' for column in range(len(s))] for row in range…
2024 October 28th
I started feeling down about my past interview performance. Rather than continue ruminating, I decided to continue my LeetCode grind tonight. My goal is to complete the Top 150 Interview Questions before the end of the year. class Solution: def…
2024 October 22nd
Getting back into the habit of solving LeetCode problems. Today's problem is LeetCode 74. Search a 2D Matrix. We have to solve this in O(log(m*n)) time complexity. So, I think of binary search in 2 dimensions. Once for the row, and once for the…
2024 October 15th
The intial phone screen for the StubHub interview went well. I was asked about my experience with Terraform. I admitted that I have only used it once before. and it has been many years since then. However, I used AWS CDK frequently at my last job…
2024 October 13th
I'm looking forward to an interview for a software engineer position at StubHub. It offers work with microservices, kubernetes, and cloud-native technologies. The position focuses on DevOps, such as infrastructure, build, deployment, and artifact…
2024 October 8th
I've began a new project, scholarships-plus. This will be a CRUD app for tracking and improving scholarship essays. I am creating this app to improve student's scholarship essays by improving their past submissions. This app will allow students to…
2024 October 7th
Today I decided to embrace the AI revolution and try out Cursor. I'm going to write a quick LeetCode solution, then dive into some project ideas. The Problem Since we have some help from Cursor tonight, we wil be solving a hard problem. Today's…
2024 October 6th
We're solving another LeetCode problem today. Tomorrow I will add my new project. Let's dive in. The Problem Today's problem is 9. Palindrome Number. The problem is as follows: Given an integer x, return true if x is a palindrome, and false…
2024 October 5th
We're solving another LeetCode problem today instead of adding a new project to my portfolio. This one is focused on bit manipulation. Let's dive in. The Problem Today's problem is 191. Number of 1 bits. The problem is as follows: Write a function…
2024 October 4th
Today is another easy problem, and it is focused on bit manipulation. Let's dive on in. The Problem Today's problem is 190. Reverse Bits. The problem is as follows: Reverse bits of a given 32 bits unsigned integer. The Solution I like to format my…
2024 October 3rd
I have already been working on LeetCode's top interview problems. I started a couple months ago in preparation for my interviews with Google. Although that has passed, more opportunities are becoming available. So, we are back on the grind. The…
2021 August 17th
More code! Mind Dump! Using prism-react-renderer: let intro = [] let stanza1 = [ "Home is where the wind fills our sails.", "Although many don't sail away from here.", "With a lake much like the sea", "Sailing what we've…
2021 August 15th
Yes! Some code! Here is the Dump component! Using prism-react-renderer: const Dump = props => ( <div style={{ fontSize: 20, border: '1px solid #efefef', padding: 10, background: 'white', }} > {Object…
2021 August 3rd
This is my third post! with a block quote!
2021 August 2nd
This is my second post! h4 Heading h5 Heading h6 Heading
2021 August 1st
My first post!! h2 Heading h3 Heading