Perfect Pair DP with Bitmasks


Perfect Pair DP with Bitmasks
one test case is not getting accepted

Your code is of complexity O(n^2). Try to solve this quest using dp with bitmasks

pls tell how to approach