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.
if we assue me they are sitting in a row first kid(10) should get more candies thand sencond(2) kid as 10 is higher ranking than 2. so distribution should be like
2,1,2,1,2,1,2,3,4,2,1 ... anyways question is not clear
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Candies
You are viewing a single comment's thread. Return to all comments →
in this sample test case 1 10 2 4 2 6 1 7 8 9 2 1
if we assue me they are sitting in a row first kid(10) should get more candies thand sencond(2) kid as 10 is higher ranking than 2. so distribution should be like 2,1,2,1,2,1,2,3,4,2,1 ... anyways question is not clear