Nykaa Interview Question

Array/Stack based question on frequency on numbers