Doubt in a question asked in linkedin coding test

Revision en3, by poerhfsdhfnc_h, 2020-11-11 09:06:51

You are given two arrays a and b each of size n. For each i (0<=i<n), you have to find smallest 'x' such that

-> x+y = a[i]

-> x^y = b[i] (i.e. x xor y = b[i])

0<=a[i],b[i]<=10^(15)

1<=n<=50

It is possible that there might be no 'x' possible. Would be glad if anyone could help...

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English poerhfsdhfnc_h 2020-11-11 09:06:51 22 Tiny change: 'x^y = b[i]\n\n0<=a[i' -> 'x^y = b[i] (i.e. x xor y = b[i])\n\n0<=a[i'
en2 English poerhfsdhfnc_h 2020-11-11 08:49:00 10
en1 English poerhfsdhfnc_h 2020-11-11 08:48:39 316 Initial revision (published)