Amazon interview question

Special array ii in leet code