Jatin and Mirror Numbers

All submissions for this problem are available.
Jatin loves _Mirror Numbers_, because he finds them very interesting and gets excited on seeing them! This is how he defines a _Mirror Number_:  It doesn't contain the digit $0$, because he hates the digit $0$.  The second half of the number can be visualized as a mirror image of the first half in _mirror order_. (If the number of digits is odd, then the middle digit is ignored while considering the first and second halves) _Mirror Order:_ The first digit of the first half is a _mirror image_ of the last digit of the second half. Similarly, the second digit of the first half is a _mirror image_ of the second last digit of the second half, and so on. Jatin considers the following digit pairs as _mirror images_ of each other: $1 \leftrightarrow 1$ $2 \leftrightarrow 7$ $3 \leftrightarrow 8$ $4 \leftrightarrow 5$ $6 \leftrightarrow 9$ Now Jatin gives you an integer $N$, you have to check for him whether this integer is a _Mirror Number_ or not. ### Input:  The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.  Each test case contains of a single line of input, the integer $N$. ### Output: For each test case print a single line containing ```true``` if $N$ is a _Mirror Number_, ```false``` otherwise. ### Constraints:  $1 \leq T \leq 10$  $1 \leq N \leq 10^{10^{5}}$ ### Subtasks:  **10 points:** $1 \leq N \leq 10^{9}$  **10 points:** $1 \leq N \leq 10^{18}$  **80 points:** original constraints ### Sample Input: 7 69 6699 6996 609 619 699 6 ### Sample Output: true true false false true true true ### Explanation:  **Example Case 1:** $6$ is a _mirror image_ of $9$.  **Example Case 3:** $9$ is not a _mirror image_ of $9$ and $6$ is not a _mirror image_ of $6$.  **Example Case 4:** $N$ contains a $0$ digit.  **Example Case 6:** $6$ is a _mirror image_ of $9$ and number of digits in $N$ are odd. So the middle digit, which is $9$, won't be any trouble.  **Example Case 7:** $N$ contains a single digit, which is ignored.Author:  ankushkhanna 
Editorial  https://discuss.codechef.com/problems/DWW19A 
Tags  ankushkhanna, ankushkhanna, cakewalk, dwwu2019, palindrome, string 
Date Added:  27122019 
Time Limit:  1 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 