Trading Central Interview Question

One leet code easy array question