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

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