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.
@decuqa I have understood how the reduction will work. But i am unable to realise the same answer using the increment algo. For ex: 2 5 5 5 5 5, the operation count would be 6 as we reduce it to 0. But how in just 6 operations we can achieve this using increment technique which is our real problem statement. So, how exactly they are same in real?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Equal
You are viewing a single comment's thread. Return to all comments →
@decuqa I have understood how the reduction will work. But i am unable to realise the same answer using the increment algo. For ex: 2 5 5 5 5 5, the operation count would be 6 as we reduce it to 0. But how in just 6 operations we can achieve this using increment technique which is our real problem statement. So, how exactly they are same in real?