Walmart Global Tech interview question

Not remember exactly but based on bitmask, implementation and dynamic programming