We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Each stick has a length l, and the length of the i'th stick is l(i-1)th.
Sample Input 1
8
4 5 1 5 1 9 4 5
Below is my understanding and I know it's completely wrong.
Now let's take 5th stick i.e i=5
So, now the length of 5th stick should be length of (5-1)th= length of 4th right ?
From the above input,
Length of 1st stick is 4, so the length of 2nd stick should also be 4?
Please explain.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
New Year Present
You are viewing a single comment's thread. Return to all comments →
Each stick has a length l, and the length of the i'th stick is l(i-1)th.
Sample Input 1
8 4 5 1 5 1 9 4 5
Below is my understanding and I know it's completely wrong. Now let's take 5th stick i.e i=5 So, now the length of 5th stick should be length of (5-1)th= length of 4th right ?
From the above input, Length of 1st stick is 4, so the length of 2nd stick should also be 4?
Please explain.