diff --git a/hackerrank/easy-flipping-bits.md b/hackerrank/easy-flipping-bits.md new file mode 100644 index 0000000..180a1fb --- /dev/null +++ b/hackerrank/easy-flipping-bits.md @@ -0,0 +1,37 @@ +Flipping bits (HackerRank) +=============================== +### Easy +![Problem Statement](./pdfs/flipping-bits-English.pdf) + +Solution +======== +```python +#!/bin/python3 + +import math +import os +import random +import re +import sys + +# Complete the flippingBits function below. +def flippingBits(n): + max_int = 0xFFFFFFFF + return max_int - n + +if __name__ == '__main__': + fptr = open(os.environ['OUTPUT_PATH'], 'w') + + q = int(input()) + + for q_itr in range(q): + n = int(input()) + + result = flippingBits(n) + + fptr.write(str(result) + '\n') + + fptr.close() + +``` + diff --git a/hackerrank/pdfs/flipping-bits-English.pdf b/hackerrank/pdfs/flipping-bits-English.pdf new file mode 100644 index 0000000..1aa7334 Binary files /dev/null and b/hackerrank/pdfs/flipping-bits-English.pdf differ