How to solve this dp+bitmasking problem?

how to solve this problem?

any other approach without dp with bitmasking?

2 Likes