Wipro interview question

Bubble code write with solution