Company: edgeq
Difficulty: easy
Remove Duplicates From a Sorted List A logging service stores the reading it takes from a sensor once per tick. The readings are appended in the order they arrive and the sensor never reports a value lower than the one before it, so the stored list is already in non-decreasing order. When the sensor sits idle it keeps reporting the same number, and the list fills up with long runs of the same reading. Before the list is archived it has to be compacted: every run of equal readings must collapse to a single copy of that reading, and the surviving readings must stay in their original order. Write a function RemoveDuplicates that takes the list and its length, keeps one copy of each distinct reading, and returns how many readings survive. The compaction has to happen inside the list the function was handed: after the call the surviving readings must occupy the first positions of that list, in order. Ideally the list should be traversed only once. Input Format The first line contains a sing