The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 399 Weeks Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Problem Description
Â
Two mathematicians Mr.X and Mr.Y are discussing about a problem. Mr.X says that the ans is a and Mr.Y says the ans is b(where a and b being string containing 0's and 1's). After arguing for a long time they find that Mr.X was giving the answer in binary code where as Mr.Y was giving the answer in Gray code. Mr.X wants to check if his ans matches with that of Mr.Y.
Â
Help Mr.X find the gray code for his binary code.
Â
Â
Â
Â
Â
Â
Â
Â
Â
Input: 3 100 011 10001 Output: 110 010 11001
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll