UBS interview question

Then again a DSA question on 2d array/vectors