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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -