The link to solution done by prateek bhaiya is https://ide.codingblocks.com/s/5974. I think the answer should not only consider the subarrays where one part is from sv1 and another from sv2 but it should also include cases where ans is purely from sv1 and purely from sv2 as well. Am i wrong???
Also please explan why the variable j is incremented only when a set bit is encountered (subsets function)? I am unable to trace that logic