Let’s exercise at leetcode?
What is leetcode ?
Well it’s the kind of question you are getting asked during interviews. That’s why I’m doing that.
Sorting
Let’s try to implement a sorting algorithm.
We will start simple with bubble sort. Given an unsorted array, we want to sort it. The idea is simple we start at index $0$ and $1$. If array[0] > array[1] we swap them, we then check 0,
python
|
|
We