Chief Hopper Discussions | Algorithms | HackerRank
  • + 12 comments

    I think the problem description is not clear...

    The range elimation is based on the vector after the element elimination.

    For example, in the sample input:

    6

    1 4 6 2 8 9

    2

    2 4

    The first elimination is to erase the 2nd element in the vector, which is 4. Then, based on the new vector {1 6 2 8 9}, we want to remove the range of 2~4, which means the 2nd and 3rd elements should be removed. Then 6 and 2 in the new vector are removed and we finally got {1 8 9} as the final result...

    Hope the above help those who did not get what the problem asks us to code...