DoorDash Interview Question

1. Union Find 2. DP