Numerator interview question

they ask for creating stack