Given a string ‘N’ that represents a number, you need to check if the given number is a strobogrammatic number or not.
A strobogrammatic number is a number that looks the same when rotated by 180.
In other words, a number that on rotating right side up and upside down appears the same is a strobogrammatic number.
For Example:‘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’.
Output Format:
For each test case, return “True”, if the given number is a strobogrammatic number, otherwise return “False”.
Note:
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
2
191
8008
False
True
Test Case 1: On rotating ‘191’ by 180, ‘161’ will be formed. So ‘191’ is not a strobogrammatic number.

Test Case 2: On rotating ‘8008’, ‘8008’ will be obtained. So ‘8008’ is a strobogrammatic number.

2
8888
543
True
False
Try to figure out the digits which on rotating upside down, generates a valid digit.
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:
O(N), where ‘N’ is the length of the string.
We are iterating through half of the digits of the string. So the time complexity is O(|N|).
O(1),
No extra space is used. So the space complexity is O(1).