Sobes.tech
Junior — Senior

Removing duplicate elements from a sorted array while preserving order

livecode

Task condition

It is necessary to modify this sorted array so that:

  • all duplicate elements are removed;
  • the relative order of the remaining elements is preserved;
  • as a result, return the number of unique elements.