An array is almost sorted if deleting at most one element sorts it. Remove as few elements as possible to get there.
An array is almost sorted if deleting at most one element sorts it. Remove as few elements as possible to get there.
Opens with the full question.