24 Game
Problem
Given 4 numbers and operations +, -, *, /, determine if you can make 24.
You are given an array of 4 integers. Each integer can be used exactly once. You can use the four operations +, -, *, / in any order, with parentheses in any arrangement. Determine if it's possible to use these four numbers and operations to produce 24.
Examples
Input: [4,1,8,7]
Output: true
Input: [1,2,1,2]
Output: false
Hints
Use backtracking to try all combinations of operations and parentheses.
Try all pairs, pick an operation, compute result, recurse with remaining numbers.
Handle floating point precision carefully for division.
24 Game
Given 4 numbers and operations +, -, *, /, determine if you can make 24.