TikTok interview question

1) Variant of knapsack problem 2) Variant of a breadth first search graph algorithm