HashedIn by Deloitte interview question

Coding round involving DSA questions