@yangshun Nice solution with some really good explanation in comments. DFS didn't come to my mind at first when I saw the question, now it makes sense. Thanks for posting it.

We can define an epsilon value like 0.0001. Since all numbers are integer within certain ranges, it is possible to come up with an epsilon value that can distinguish a real 24.0 or a number near 24.