Given a gray code for a number, find the binary code for the number.
Gray code is a binary numeral system where two successive values differ in only one bit.
For Example two bit gray code is: 0 - 00 1 - 01 2 - 11 3 - 10
Binary is:
0 - 00 1 - 01 2 - 10 3 - 11
Provide an algorithm to convert the gray code of the number to binary code.
For example, input is 11. Expected output is 10.