Q38Multiple correct4 Marks6 Aug 2023
We have a non-empty list `Location` that stores city names from the Scores dataset, sorted in alphabetical order. This results in many duplicates. The following procedure attempts to extract the unique list of cities while preserving sorted order. The pseudocode may have mistakes. Identify all such mistakes, if any.
```
uniqueList = []
uniqueList = uniqueList ++ [first(Location)]
prev = last(Location)
foreach x in rest(Location) {
if(x != prev) {
uniqueList = uniqueList ++ x
}
prev = x
}
```