

If the cards Ninja chooses are 4, 1, 8, 7. Then Ninja can make 24 by (8 - 4) * (7 - 1). Hence Ninja can win, so you have to return true.
The division operator ‘/’ represents actual division, not integer division. For example, 4 / (1 - ⅔ ) = 12.
The first line of input contains an integer ‘T’ denoting the number of test cases to run. Then the test case follows.
The next line of each test contains four space-separated integers denoting the cards which Ninja has.
For each test case, print true if Ninja can win the game; otherwise, print false.
Print the output of each test case in a separate file.
You do not need to print anything, it has already been taken care of. Just implement the given function.
1 <= T <= 3000
1 <= NUMS[i] <= 9 where 0 <= i <= 4
Time Limit: 1 sec
We can use the bracket(), so that simply means the order of operations doesn’t matter. We can operate any two cards in any manner.
So will check all possibility of every 2 cards then we will use the result of these operations with the other 2 cards. When we get one number, as a result, check if it is 24+0.0000001, then return true, else return false.
Algorithm:-