My submission still gets wrong answer verdict, you can check my code here.
My idea is:
- treat it as a vertex cover, then find which i(s) have the most relation with others
- find subsets that contain i(s)
- iterate through the chosen subsets to find the minimum sets
I tried with some test cases I can think about and it’s giving the optimal/minimum set cover but I still get wrong answer verdict after the OJ is running on the 10th case. Anyone has any idea what’s wrong?
Thank you in advance.