TetraSoft Interview Question

Medium complexity