life is too short for a diary



Posts Tagged: python (Page 8)

Getting Started with decorators in Python

In python, everything is an object. So functons are also objects which can be passed around. A decorator is a function that receives a function and returns a function...

Continue reading → python



Minimum Consecutive Cards to Pick up solution leetcode

An interesting problem on leetcode to find minimum number of ways to pick up consecutive cards. We will start with a brute force algorithm that would exceed in time limit. Later we will improve upon this algorithm using hashmap...

Continue reading → leetcode java python hashmap



Do you have triskaidekaphobia?

I grew up in India with a diet of basmati rice and superstition. I have seen pedestrians freezing at the sight of a black cat crossing their path for fear of bad luck. Lemon and chilis hang in front of vehicles to ward off bad spirits. I fondly remember numerous advertisements proclaiming protection from evil eyes. Recently I stumbled upon an ad that refreshed my memories...

Continue reading → superstition rationalism python