Guidewire interview question

Codility exam