ONE___PIECE's blog

By ONE___PIECE, history, 21 month(s) ago, In English
  1. Can anyone please provide a simple testcase on which this code fails. I am not able to find such a case.
Code
  • Vote: I like it
  • -4
  • Vote: I do not like it

»
21 month(s) ago, hide # |
 
Vote: I like it +7 Vote: I do not like it
1
1 3 2
15
5 6 9
Output: 1 : ((15 & 5) & 9) 
Answer: 0 : ((15 & 6) & 9)

You should calculate prefsum array by trying all combinations of array b (backtrack)