Walmart Global Tech interview question

It was based on sub array and operators