Featured Post

Hello! and Greetings! Nice to see you on my blog.

 

11/01/2022

LeetCode Day 36

 I definitely had some revelations today. The theme for today is taking that extra step while practicing. Truly understanding whats going on, because thats how it sticks in your brain and thats how you learn.


To start off, the first problem went off to a speedy start, I knew the right way to code it 10 minutes in. It was awesome. However, my implementation had bugs. It seems that when passing in values that are mutable, the function can change those values such that those changes are displayed to the callers.


Ex.  

However! if the objects are immutable like (ints, floats, strings, tuples). Then the method creates a local name for that object, and it is now passed by value.

The second problem... was....really...tricky


It was about finding the minimum height tree. The fallacy I exhibited was not understanding the problem well enough. I should have spent more time up front, and working my way step by step to the solution. I didnt do horribly tho.






10/24/2022

Leetcode Day 35

 Today, I revisited an old problem that I wasn't able to complete before. This time I did really well. It was an insanely hard problem, but I did 80% of it. I think that if my python skills were a little better, I would have come really close to completing it. The problem was constructing binary trees with a list of its inorder traversed elements and preorder traversed elements. Something that I learned today was the keyword nonlocal in python. It allows an inner function to refer to a variable referenced by the outer function.


Here is my code.



10/16/2022

Leetcode Day 34

 My brain was not up to speed today. I think its the weekend effect. I did manage to complete two leetcode problems today. I completed the Partition Equal Subset Sum & String to Integer (atoi). I did really well on the partition equal subset sum. I was obsessed with finding the most optimal solution that I already came up with it and decided to dig deeper. I ended up using neetcode to find the solution, and he used the same solution I came up with😭😭😭. Dynamic programming is a different monster each leetcode problem. Find the recurrence relation first, before starting to code. Also, work backwards.


I used a lot of sudo code in this problem. (partition equal subset sum)

I should go over knapsack problem, and memoization in the future. Im too lazy today, but I will in the future.

Thats it for today!!!


10/01/2022

Leetcode Day 33

 Today I completed two problems. First time doing leetcode in two weeks. I decided to take a break because I sort of got an internship offer letter from a big company and wanted to chillax. Basically, I took it upon myself to relax from all my hard work. Anyways, today wasn't too bad. Ill post the solutions to both problems that I had below. One of the problems I had had such a small detail that would have decreased my time complexity so much. It was a really really really nitty gritty detail to miss.

981Time Based Key-Value Store



33Search in Rotated Sorted Array





9/28/2022

Made insane amount of progress in an hour

 Sometimes 1 hour of your work is the most crucial one. It's the one that has all the meat. In that one hour today, I fixed the voice commands, and got all the QR detection to work perfectly. It felt like getting the last two seater on the bus. It was like listening to kanye west. Pure bliss. I added all the voice commands to unity's mixed reality tool kit, and modified all my C# code to match with the voice commands. Once again, I promise I will have a huge blog post at the end explaining everything. But for now, this is all you get.


My expression after that 1 hour of progress: 








I want to talk about how much little information there is on the internet on the Hololens. I mean a simple task like QR detection took days. 67 hours to be exact. OK some of that was for exploring the hololens, exploring the project, and learning unity. But yk what I mean. Why is it so difficult? Man, I am glad to have this experience. I feel like I am going to learn so much about patience.

I outsourced and reached out.

 I wasn't getting anywhere with the project after fiddling with it for hours. I mean HOOURS. I ended up asking an XR export in my university and thank the lords because he helped so much. He deserves so much good karma for helping me for no money. He helped me parse through the project, and I was able to change the qr detection symbol. I know none of this makes sense, but I promise I will post a demo of everything at the end. I just can't right now because all of the files are in the XR lab lol.

Idk what i'm doing

 Imposter syndrome was really settling in. But I worked through it. I worked through it all. My task for this week is to change the qr symbol when it gets detected. And um... I got nowhere. But yk my understanding of the QR detection service itself was skyrocketing. I was getting a lot of low level knowledge of the program.

I've moved on to Microsoft's QR detection.

 I went to the source for this one. I went directly to one of the hololens developers employed by Microsoft. I checked out their github and luckily they just updated their github to a new version of QR detection. IDK how I got so lucky. 

I felt like this dog.


I was so so happy!!

Anyways integrating this new qr detection was so easy. All the information was right in front of me.
All of the unity versions, project settings, Nuget packages were all updated. Definition of awesome seriously.








UGHSFJHSJHF

 



So apparently, I've had the wrong project file this whole time.... Plus as an add on,
I CANT DEPLOY from my PC. Its not possible.... It doesn't have the right architecture. I've wasted
so much time. I guess this is what working and researching is all about. I tried my best to fix all 
my problems. I put in so much effort. It's ok!!! It's all about being optimistic

9/11/2022

Leetcode Day 32 (continued)

 I forgot to mention that I learned some new methods with sets.


One is called union. which merges 2 sets together.


The second, update, does the same thing, but you are able to specify which set becomes the alpha. If that makes sense.

Leetcode Day 32

 An unorthodox day. Both of the problems I completed today were along the lines of real world problems. This made it a lot more entertaining to solve. The first problem I completed was executed perfectly. I actually did an extra step that was not needed because I didn't read the problem rules correctly. Although the execution was perfect, the results were not. Not all test cases passed and I was too lazy to fix the bug, but my code was almost identical to the ones as a the solution.


Some things to REMEMBER for this problem:

- the order of enumerate is index,value. Thats the order when you are for looping.

- Also there are such things as sortedmaps in python. It gets instantiated by Sortedmap(). There are some special methods attatched to this data structure to make it work, but overalll.... It's super useful.


The second problem I faced was a monster. The problem wanted a FAANG level algorithm out of me. The correct algorithm to solving the problem was Union Find. This uses groups, merging, representatives, parents. Its a complex one. Not sure if any internships interviews would ask for it.... but yk. It doesn't hurt to get familiar with it.


Dis da video I uzed to get familiyar


Also the nxt video is how to solve the second leetcode monster question I was talking about..
So yk, come witness Union Find in action!





9/05/2022

LeetCode Day 31

I'm back from a long break away from leetcode. Long meaning 1 week and a half. So really not that long. But it feels long. I wasn't too rusty, but getting into the rhythm is hard. The first problem went well. I came up with a O(n) time and O(n) space solution. The most optimized was O(1) for space and same time complexity. If an interviewer were to ask me to optimize my problem, I think I could have handled it for sure. The problem was about finding the product sum of every element of the array and populating a result array with that value without the included product of the element at that position. (Product of Array Except Self) With problems that need the values from every other element, its nice to think about prefixes and post fixes. So basically iterating through the array forward once and backward once. Kind of a neat trick. I did well on it.

The second one tho...

Pretty complicated. I was able to solve every part of the problem besides the hardest part which is something that is often in a lot of leetcode problems. This component is the idea of a result array to not have duplicates. This means that the way to solve the leetcode has to be done in a special way where it inherently doesn't allow for duplicates. 

I should draw a little more. Decision trees help solve A LOT of these medium problems. Also, neetcode is the GOAT. He's great. he should work at amazon and google at the same time. he can handle it. 

Here was the drawing I did...




The second one in hindsight is super hard however if its the first time seeing a problem like that. I think an interviewer would appreciate my approach.

One weird thing did happen while I was coding. My list/array skills were failing me. the code was producing a list that was not even close to the thing I wanted. I couldn't find the bug, I hope I run into the issue again to fix it. 

P.S. when passing down a variable in python. REMEMBER THAT ITS PASSED BY REFERENCE. SO BECAREFUL WHEN THE SAME VARIABLE IS USED IN MULTIPLE CALLS. USE .copy() method if you have to.


Been busy with moving into school...

 Took a break from leetcode,research, and everything. Got settled in...

8/21/2022

I can see the light at the end of the tunnel

 I think I'm getting really close to finishing up my personal website. SOO SOO close. I finished up the final section of my website. It goes at the bottom, a little cheeky contact section.


Check it out.



It was really difficult for me to get the vibe of this section to go along with the rest of the website. I also added some more info to the "get to know me" part of the website. I finished with majority of the website. I just need to add info and some pictures/videos. 

But first, I have to make sure my personal projects work well LOL. I haven't touched them in ages.

'Till next time.



8/20/2022

LeetCode Day 30

 I started practicing medium difficulty questions on leetcode starting with three sum. That was a difficult problem. I haven't done two sum 2 which was the sub problem of three sum. So three sum ended up being two sum 2 but slightly trickier.




I ended up using a very inefficient solution that kept duplicates. The solution format I was going for while solving this problem was creating combinations while iterating through the nums array. It worked! But it kept duplicates! I tried making the array into a set, then back to an array. Didn't work πŸ˜…. I also tried sorting the initial array and then skipping the duplicate numbers. Didn't workπŸ˜…. 


I ended up watching neetcode....



Learned thangs:
- starters, sorting a list can be done two ways. nums.sort()
or sorted(nums). (totally forgot about this, been a while since I've visited arrays section)
- Second, sets can't really be used on double lists. List inside a list. It's because a list itself is not hashable, so the set doesn't know what to do. No real way to delete duplicated lists without getting you're hands dirty.
- Third, some mediums are so dang hard. But its a learning process. My thought process went pretty well this time. I started with the brute force, and worked my way to my solution. I just didn't think about how 3 sum could easily become a two sum problem. I should have drawn on my past experiences more.
- This problem needed a left and right pointer to complete it which is crazy. Didn't even need a hashmap. I should have done two sum 2 first.... Doing it step by step is always better.
- Everyone has a hard time with leetcode. Take youre time and work through it. You'll eventually get better.





8/18/2022

POP UP IMAGES

 I added pop up images to my website. It was actually really tedious to figure out in a react based web app. I tried so many different websites and searching, but only one of them worked for me. 



Here it is!!!!





LeetCode Day 29

 I ran into a problem that I've never run into in the past. It was soo weird. I feel like I should have run into this issue before, but I haven't. The problem I ran into was scopes, local and global variables. The solution to the leetcode I was solving consisted of a nested function. In that nested function, I attempted to modify a variable in the outer function, but It didn't work. Lots of leetcode problems ask for this so I was so stumped as to why there was an error getting thrown now.


Heres what Im talking about:

Theres a couple fixes to this. The one I chose was to specify the variable at the top with nonlocal. I could have also used the keyword global. That would have worked. ORRRR I could have specified in the outer function this.diam = 0 instead of diam = 0. the keyword This shows that it is a parameter of the object.

Super weird small issue I ran into. Other than that, Leetcode went gracefully today. Happy with my results!!!!!!


8/17/2022

Update number 2

 You would think that scanning a simple qr code would be easy on this device. It should be. It really should be. But for some reason, there is no standard. SO I have to keep testing different apps for qr recognition. I tried a new one today because I just didn't feel like dealing with the plethora of issues I ran into with the QR code standard on microsoft. I tried a new qr code app which originates from microsofts standard version. New Git hub repo. It worked decently well. Didn't get to test much cause my hololens died. πŸ₯²,πŸ₯²,πŸ₯²

This app seems very unrefined and its gonna need some work to be able to display an object, but I just want to make small steps at first. I also found a new way to deploy a unity project to the hololens. Its faster, and a bit cooler. I'm gonna need to test this out more...


That's all from me today!!!

LeetCode Day 28

 There's a fine line between irrelevant programming trivia and tricks in your programming language. Python always has me riding that fine line. There was a question today that was easy to complete in python because I knew the nuances of two functions. First the int function can take in a second parameter which specifies the base of the object being converted to decimal. Also, there is a bin() function that turns a integer or a number to binary.

Does this count as trivia or a trick I should know...

Who knows anymore? I should refresh on this before an interview tho... just in case...


Anyways I found this weird algorithm that I thought was cool. Probably won't use it in an interview BECAUSE THIS IS DEFINETELY IRRELEVANT PROGRAMMING TRIVIA.


Look, there is no chance I would be able to come up with this during an interview, and I'm not going to memorize it. 


Neat right?


8/16/2022

LeetCode Day 27

 It's my first day of cumulative practice on LeetCode questions. I feel so much smarter than when I first started. I did two easy difficulty problems, and they weren't bad at all. The first one I came up with the solution pretty quickly, but had a very messy solution. It was just silly mistakes and not taking care of edge cases well that let to it.



I mean... look at that. I could have done that in 5 lines if I wanted to.

The second question was smooth as  butter🧈🧈🧈🧈🧈. 

Although,
 I only did two problems today. I felt way more confident. Not many tips for today!!! Whoop