Alisa
BAN USERSolution is to reverse every number in row and than reverse row:
def reverseNumb(numb):
result = 0
for i in xrange(63, -1, -1):
result += (numb & 1) << i
numb >>= 1
return result
def reverse(arr, width, height):
for i in xrange(height):
for k in xrange(width / 2):
leftInd = i * height + k
rightInd = i * height + width - k - 1
arr[leftInd], arr[rightInd] = reverseNumb(arr[rightInd]), reverseNumb(arr[leftInd])
if width % 2 != 0:
arr[width / 2 + 1] = reverseNumb(arr[width / 2 + 1])
def findTwo(A, B):
difference = sum(B) - sum(A)
differenceSqrs = sum(x ** 2 for x in B) - sum(x ** 2 for x in A)
a1 = int((difference + (2 * differenceSqrs - difference ** 2) ** 0.5) / 2)
a2 = int((difference + (2 * differenceSqrs - difference ** 2) ** 0.5) / 2)
if sum(1 for x in A if x == a1) != sum(1 for x in B if x == a1):
return a1, difference - a1
return a2, difference - a2
Repzhenhsiungz, Android test engineer at AppPerfect
I am a financial planner . I help individuals and corporations meet their long-term financial objectives. I enjoy spending my spare ...
RepHvactools, maintenence engineer
HVACTOOLS.co.nz now stocking all Javac and Spectroline HVAC and Refrigeration products. Including Recovery Units, Vacuum Pumps, Leak detectors ...
As far as kernel mode considered as trusted, any instructions and any references to memory addresses could be executed in the kernel mode. User mode in entrusted, thus to run operations such as read\write and process creation you have to trap to kernel mode.
- Alisa August 08, 2016