Featured Post

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

 

9/11/2022

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!





No comments:

Post a Comment