Amazon Interview Question (HELP)

Can anyone help me with approach of this problem …??

1 Like

Thanks!!!

1 Like