Tip 1: Initially, spend some time on DSA.
Tip 2: Go through the puzzles asked in interviews before attending the interview.
Tip 1: Include some projects on your resume.
Tip 2: Do not include false information on your resume.


The width of each bar is the same and is equal to 1.
Input: ‘n’ = 6, ‘arr’ = [3, 0, 0, 2, 0, 4].
Output: 10
Explanation: Refer to the image for better comprehension:

You don't need to print anything. It has already been taken care of. Just implement the given function.
What is virtual memory? (Learn)
What is a thread in OS? (Learn)


Given ‘N’ = 4,
'ARR' = { 4, 3, 2, 1}
Then a possible array is 3, 4, 1, 2.
You are supposed to return the array, which is in a zig-zag fashion.
Since there can be multiple answers for a particular array, any of the possible solutions are accepted.
It can be proved. A zig-zag array is always possible for a given array.
We have two water jugs: one with a capacity of 4 liters and the other with a capacity of 9 liters. However, there are no measuring marks on either of the jugs, meaning we cannot determine the exact amount of water filled in either jug. Assuming there is an infinite water supply, how can we measure exactly 5 litres using these unmarked jugs?

Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
What is recursion?