Approach for Cooking Game

Please share your approach for cooking game in February cook-off.

1 Like

put arr[1] = 1 , if arr[i] = x , then put arr[i - 1] = x - 1 , arr[i - 2] = x - 2 … till it becomes 1 , now answer is just 2 ^ (count of -1’s).

3 Likes