Numerator Interview Question

they ask for creating stack