Skip to content

Commit 8b5721d

Browse files
committed
Add solution for wk28 problem 2
-the great xor
1 parent 9544fce commit 8b5721d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

hackerrank/the-great-xor.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# !/bin/python
2+
# https://www.hackerrank.com/contests/w28/challenges/the-great-xor
3+
4+
for query in xrange(int(raw_input().strip())):
5+
x = long(raw_input().strip())
6+
count = 0
7+
for a in xrange(1, x):
8+
if a^x > x:
9+
count += 1
10+
print count

0 commit comments

Comments
 (0)