Nagarro interview question

Complexity of Quick Short