DEV Community

Discussion on: Reintroducing Code Review with an Interview Question Asked at Amazon

cindyytong profile image
Cindy Tong Author

Hi David! Nice work here. Love that you went beyond the ask and even added the frontend for this. Some things to consider for the future:

  1. What happens if we call arrayAddition([1,1])?
  2. What if we wanted to eliminate complexity a bit and minimize the number of new arrays we're creating. How could this be solved without using flat() or filter()?

We'll be posting our approach to this problem tomorrow. Looking forward to seeing more solutions/thoughts from you throughout our series.

dbenchi profile image
David BENCHI • Edited on
  1. fixed
  2. we could do so by determining in advance the different combination we have. SO we may apply this combination on the original input directly.

Now I follow you on So I will try to answer new challenges if I have time.
Thanks a lot