Skip to main content

About Me




To all those who landed here…

Hi,

I am a software developer by profession. I work for a famous firm. But this place is not about all these things.

I have still not figured out why I have started this website, but I think things will become evident with the passage of time.

For now, all I can say is I will try to post things that are educational and practical to me.

That's it from my side :)

Popular posts from this blog

CodeChef March Challenge 2021 — Consecutive Addition

“You are given two matrices A and B, each with R rows (numbered 1 through R) and C columns (numbered 1 through C). Let’s denote an element of A or B in row i and column j by A(i,j) or B(i,j) respectively….. ” You can read the whole problem here . Problem description in short Given two matrices, A and B. Task is to transform A to B using special some addition-based criteria. The criteria for transformation is as follows we are given a number K 2 ≤ K ≤ min(R, C), where R is row size and C is column size we have to take any submatrix of size Kx1 (i.e. along the column) or 1xK (i.e. along the row), in A, and to all the numbers that fall under that submatrix have, add some integer v, this can be chosen by us. This has to be done in such a way that finally A transforms to B. The actual problem is to check if this kind of transformation is possible, given A and B. Ideation…. Befor e  I begin I wanna say that it is an observation based problem, can have many solutions and my solution is not pe

Chocolate in the Boxes

Counting problems have been irritating people for ages. They are generally long and weird with additions — substractions going on in different parts with meanings difficult to understand. Out of all the popular counting problems, one can be solved using some chocolates and boxes, which I am going to discuss in this article. The Problem For the given equation, find the number of ways such that a, b, c, d has a whole number solution, i.e. a, b, c, d ≥ 0. Most of you might know the formula for the pr o blem, here we are going to discuss a thought on how to tackle such a problem and formulate it as people find it tough to memorize and often forget. Before discussing further let’s see what the chocolate problem is. The Chocolate Problem Let’s say, we have 10 chocolates, that we need to put in 4 different boxes. It is assumed that all the chocolates are identical, and we are asked to count the number of ways to put the chocolates into the boxes. Putting no chocolates at all into the box is t

Climbing the Fibonacci Sequence

  Climbing Staircase Problem T he Story begins with a Problem Yesterday, I was solving a very famous DP problem,  the climbing stairs . The problem is quite simple. You are climbing a staircase. It takes  n  steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Solution The solution is also pretty straight forward. Suppose we have climbed up some steps and we are left with some  i  steps to reach the top. Let’s say,  NoOfWays(i)  be a function that returns the number of ways to climb  i  steps to reach the top. If we climb by 1 step, then we are left with (i-1) steps. Using the above formula, the number of ways to climb (i -1) steps = NoOfWays(i-1). Similarly, if we climb by 2 steps, then we are left with (i-2) steps, and using the formula, the number of ways to climb (i -2) steps = NoOfWays(i-2). Since we can climb in one of the two fashions only so the number of ways to climb  i  steps is given as follows For the b