Microsoft interview question

they asked two DSA question