
‘986’ is a strobogrammatic number because on rotating ‘986’ by 180, ‘986’ will be obtained.

The first line contains an integer ‘T’, denoting the number of test cases.
The first line of each test case contains a string denoting ‘N’.
For each test case, return “True”, if the given number is a strobogrammatic number, otherwise return “False”.
You don’t need to print anything. It has already been taken care of. Just implement the given function.
1 <= T <= 50
0 <= N <= 10^5
Time limit: 1 sec
Out of all the 10 digits, 0,1,6,8,9 will give a valid digit when rotated upside down(top part turned to bottom).
After rotating upside down digits will be-
0 -> 0
1 -> 1
6 -> 9
8 -> 8
9 -> 6
We will use two pointers, 'START' and 'END', pointing to the number’s starting and ending digit.
By rotating the number right side up, the digit at 'START' will be replaced by the digit at 'END'. Now, if the digit at 'START' is a digit other than (0,1,6,8,9), then the number can never be a strobogrammatic number.
Otherwise, we will find if the digit at 'START' on rotating upside down appears the same as the digit at 'END'.
We will check this for all values until 'Start' < ‘END’.
If for all values of 'START', digit at 'START' on rotating upside down appears as digit at 'END', then the given number is a strobogrammatic number.
Algorithm: