donnemartin / interactive-coding-challenges

120+ interactive Python coding interview challenges (algorithms and data structures). Includes Anki flashcards.
Other
29.57k stars 4.46k forks source link

test_pairwise_swap test case is incorrect #306

Open marvin659 opened 1 year ago

marvin659 commented 1 year ago

self.assertEqual(bits.pairwise_swap(1), 1) is incorrect. According to the description, the result should be 2.

i.e. 0000000000000001 should result in 0000000000000010 which is 2 instead of 1.

eamanu commented 1 year ago

Please, provide an PR to fix it.