Home > Reflections | ⏮️ ⏭️

# 2024-07-02

## 🏋️ Coding Practice

### 26. Remove Duplicates from Sorted Array

Given an integer array

`nums`

sorted innon-decreasing order, remove the duplicatesin-placesuch that each unique element appears onlyonce. Therelative orderof the elements should be kept thesame. Then returnthe number of unique elements in`nums`

.

Consider the number of unique elements of`nums`

to be`k`

, to get accepted, you need to do the following things:

- Change the array
`nums`

such that the first`k`

elements of`nums`

contain the unique elements in the order they were present in`nums`

initially. The remaining elements of`nums`

are not important as well as the size of`nums`

.- Return
`k`

.

#### 🪞 Reflections

- < 14 minutes is good
- no bugs is pretty good
- the test case may have been a bit longer than necessary, but it got the coverage we needed and we finished in time
- testing gave confidence in the correct code
- I remember planning this problem in the past without coding the solution
- I didn’t reference my old planning notes, but I did remember the approach
- Planning took about the same amount of time this time as it did last time