life is too short for a diary

Most popular



Upvote next


Lowest Common Ancestor of a Binary Tree

Questions involving the binary tree data structure are very popular in tech interviews, and can be challenging and varied! A binary tree is a data structure consisting of a collection of nodes (starting at a root node), where each node consists of a value (data), together with a directed edges to at most two nodes (the "left child" and "right child"), with the additional conditions that no two edges point to the same node and no edge points to the root. I recently solved an interesting problem on binary tree...

Continue reading → Tags : leetcode java python javascript scala






Ternary String solution Codeforces - 1354B

Ternary string is an interesting problem that could be solved using two pointers techniques. It's a convenient way to keep track of multiple indices. This helps in making decisions based on two values...

Continue reading → Tags : codeforces two pointers java python






Coin Change solution leetcode

It's one of the most popular questions on leetcode that seems very easy at first. Coin change is a classic dynamic programming problem. I will proceed with an obvious (albeit wrong) solution and subsequently proceed to an efficient correct solution...

Continue reading → Tags : leetcode dp java python






Dear Vishi, is snoring innocuous?

I was an intern working in Upstate New York. Public transport required hopping multiple trains & buses and was woefully tedious. I found some other interns who were willing to split the fare with me for Uber. Even a ride in Uber consumed more than two hours. Occasionally I used to steal a quick nap. After a siesta of a few hours, I had always woken up with a gaggle of laughter. My peers often pulled my leg, "You were snoring like a pig". However, I dismissed my faux pas as just a mere nuisance...

Continue reading → Tags : snoring sleep apnea diary letters audio