solution to code eval's bit positions question