algorithm - Partition into sub-sequences that XOR to 0 -
given array [a1, a2 ...an], partition sub-sequences maximizes quantity of xor 0. return count of sub-sequences.
examples:
input : 3 0 2 2 partition: [3] [0] [2 2] output : 2 members : [0] [2 2] input : 5 3 1 2 5 6 3 7 4 0 8 partition: [5] [3 1 2] [5 6 3] [7 4] [0] [8] output : 3 members : [3 1 2] [5 6 3] [0]
i searched tips on google , languange engine, can not hint.
Comments
Post a Comment