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 have {2,6,6,6} if i use addition approach it will be {(2),7,7,7} {7,(7),12,12} {12,12,12,(17)} {17,17,17,17} and know if i use subtraction approach i.e subtracting one ,two or five from one element at one time it will give me same number of operations . {1,6,6,6} {1,1,6,6} {1,1,1,6} {1,1,1,1} so number of operations are same in both the cases.
now you got it
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 →
if we have {2,6,6,6} if i use addition approach it will be {(2),7,7,7} {7,(7),12,12} {12,12,12,(17)} {17,17,17,17} and know if i use subtraction approach i.e subtracting one ,two or five from one element at one time it will give me same number of operations . {1,6,6,6} {1,1,6,6} {1,1,1,6} {1,1,1,1} so number of operations are same in both the cases. now you got it