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.
You have to think about the situation like about different Numeral_system. For example word: "cxrzy". "c"=1, "r"= 2, "x"=3, "y" =4, "z" =5
So we have number "13254".
So the nubmer we need: "13425" => "cxyrz"
Find symbol/position where number is lower than previous when you go from end to begin. It will target1.
Find symbol wich is more than target1 by value, but the closest one. It will be target2.
Bigger is Greater
You are viewing a single comment's thread. Return to all comments →
Here a good comment: https://www.hackerrank.com/challenges/bigger-is-greater/forum/comments/52690 But I wrote my text before I read the solution.
You have to think about the situation like about different Numeral_system. For example word: "cxrzy". "c"=1, "r"= 2, "x"=3, "y" =4, "z" =5 So we have number "13254".
So the nubmer we need: "13425" => "cxyrz"