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.
Problematic question, which the writers probably didn't really thought through. Let's have a look at the example that they gave: q = [4,1,2,3]. The problem description suggests that this would be "TOO CHAOTIC". But it is not, 1 would bribe 4 to get to its original position and the new queue would be q = [1,4,2,3]. Then 2 and 3 would do exactly the same in the respective order and everybody would be in their position. There would occur 3 bribes and everybody would be in their position. So what are the actual rules to do the bribing? I believe this question is faulty and needs some new rules to be introduced.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
New Year Chaos
You are viewing a single comment's thread. Return to all comments →
Problematic question, which the writers probably didn't really thought through. Let's have a look at the example that they gave: q = [4,1,2,3]. The problem description suggests that this would be "TOO CHAOTIC". But it is not, 1 would bribe 4 to get to its original position and the new queue would be q = [1,4,2,3]. Then 2 and 3 would do exactly the same in the respective order and everybody would be in their position. There would occur 3 bribes and everybody would be in their position. So what are the actual rules to do the bribing? I believe this question is faulty and needs some new rules to be introduced.