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
Amy is a bright kid. She recently learnt the numbers from 0 to 9, and spends all her time these days, trying to write larger numbers. One day she wrote a number on a paper, and turned it upside down. It surprised and amazed her that the writing on the paper still made sense.
So, now she has created a game for herself, where she writes numbers and looks at them upside down to see if it still is valid. Help Amy in this game.
For each of t testcases,
Given a number n, find if it is valid while being viewed upside down.
If the number is valid print YES followed by the new number in the next line. Else print NO.
1
1
Input: 2 1968086 12345678 Output: YES 9808961 NO
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