Tiktok OA - Good subset of a Binary Matrix [HARD]🔥🔥🔥

This is the first programming problem in Tiktok's online assessment, really hard for me! I assume that if there is a subset, it must be length of two, and I passed all the test. But later after the finishing it, I realize that it's not true, e.g.
111000
100110
010101
001011
image

Any one knows the general approach? The value range is:
n <= 2e5, m <= 8

Comments (5)