Reverse Shuffle Merge

  • + 0 comments

    @AbshishekVermaIIT - As you mentioned in point 6: If we always need to pick the lowest character seen so far, unless it is critically required to be placed, consider the scenario for "beiouuoieb".

    In this case, while traversing right to left, smallest character seen so far is till index 4(u -> right to left) is 'b'. we may hold this character and never hold e (after that). as b < e and b is also not critically required as we will consider it for final result at last character at index 9.

    so the output will become - 'buoie' We would need a backtracking here which is missing in this algo right?