Compact a sorted price ladder in place
A price ladder arrives as a sorted (non-decreasing) list, but some levels repeat. Overwrite the array in place so the first part holds each distinct price once, in order, and return how many distinct prices there are. Elements past that length may hold anything.
prices = [10, 10, 11, 12, 12]
-> 3 with prices[:3] == [10, 11, 12]
Compact the sorted array in place and return the count of distinct values. Aim for time, space.
Your answer
This one is open-ended. Work it through, then check your reasoning against the full solution.