Given a binary matrix of N X N of integers , you need to return only unique rows of binary arrays eg: 0 1 0 0 1 1 0 1 1 0 0 1 0 0 1 1 1 1 0 0 1 1 1 0 1 ans: 0 1 0 0 1 1 0 1 1 0 1 1 1 0 0 |
用数组表示一行操作不方便,可以看成二进制,将一行变成一个整数,此题就变为在一个整数数组中寻找不重复的数,用hash_map , 排序都行