In the code we have done the problem for all subsequences like…example … if i give input “abc” we get the answer for “a” “b” “c” “ab” “bc” “ac” “abc” … if i want to do it for continous subsequence only …like…i in string “abc” i want for “ab” “bc” not “ac” as it is not in continous…like in 123 …i dont want 1 and 3…so what should i do?
For Continous subsets only
Then bitmasking can’t be used.
We used bitmask for all subsets because we knew that numbers from 0 to 2^n will give all combinations
so how this question can be done???..this is of bitmasking only
what can i do for this problem??
Hey you don’t need to close this doubt and then reopen it again and again.
You may open a fresh thread though.
For this problem, you can first calculate that a particular ar[i] would come into effect in how many subarrays.
Then you can simply proceed by taking xors of each ar[i] that number of times.