UVa 11173 — Grey Codes with a one-liner bit manipulation expression for each test case, i.e. find the k-th Gray code.
Solution is k^(k>>1)
Let’s reverse the UVa 11173 problem above. Given a gray code, find its position k using bit manipulation.
Solution: ????