This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*# The first 12 digits of pi are 314159265358. We can make these digits into an expression evaluating to 27182 (first 5 digits of e) as follows: | |
# 3141 * 5 / 9 * 26 / 5 * 3 - 5 * 8 = 27182 | |
# or | |
# 3 + 1 - 415 * 92 + 65358 = 27182 | |
# Notice that the order of the input digits is not changed. Operators (+,-,/, or *) are simply inserted to create the expression. | |
# Write a function to take a list of numbers and a target, and return all the ways that those numbers can be formed into expressions evaluating to the target. Do not use the eval function in Python, Ruby or JavaScript |