number in -2 (minus two) bases
Difference between en1 and en2, changed 4 character(s)
Given a number in base -2 in binary form. return negative of that number in base -2 in binary form.↵
Given [1,0,0,1,1,1] => return [1,1,0,1,0,1,1]
 .
[1,0,0,1,1,1] = -23 (from left) , neg(-23) = 23↵
in base -2, 23 is [1,1,0,1,0,1,1].↵
Length of the given array <= 10^5↵

Any idea? Thanks in advance.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English ndatta 2015-10-17 10:49:04 4
en1 English ndatta 2015-10-17 10:48:01 327 Initial revision (published)