Hi guys Is the the problem below, hard or medium? https://leetcode.com/discuss/interview-question/1367405/shopify-coding-on-site-package-matcher YOE: 10 TC: $210k #faang #amazon #facebook #square #google
Poll
Medium
Wtaf
Easy
Super easy based on you can fit only one type if item in the box
Easily solvable using modulo to fit as many as possible of the same kind. It would be medium if you could mix and match (one speaker and one camera). Also medium if they asked for the packaging using the least amount of boxes (DP)
I got the same problem in my first round. I think it's easy. One utility function to get count of all products. In another function decide boxes for each product and return the mapping(can be fine boys simple modulo). Them test 2 functions separately. Dp may not be necessary and they were happy with this.
The modulo wouldn't help right because if I sent in 1 Game only the large box could accommodate it. if you did a 1 modulo 2 ( capacity ) you'd get 1 which doesn't help because that means you have to try a smaller box to pack the overflow. Game doesnt have a smaller box
Boxing Rules(prioritize which box to consider) them modulo to fill boxes in order.
Poll