Google interview question

Implemented bubble sort in the most efficient way