Given a number N. Your task is to check whether it is fascinating or not.
Fascinating Number : When a number( 3 digit or more) is multiplied by 2 and 3 ,and when both these products are concatenated with the original number, then it results in all digits from 1 to 9 present exactly once.
First line contains number of test cases T. Then following T lines contains a positive integer N.
Print "1" (without quotes) if given number is fascinating else "0" (without quotes) .
1 <= T <= 200
100 <= N <= 107
Testcase 1: After multiplication with 2 and 3, and concatenating with original number, number will become 192384576 which contains all digits from 1 to 9.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.