Interview question of the issue #320 of rendezvous with cassidoo.
Given two integers source
and target
, add operators in the source
number to make it equal target
, if possible. You can return just one, or all possibilities for this!
Example:
> addOperators(123, 6)
> ["1*2*3", "1+2+3"]
> addOperators(3456237490, 9191)
> [] // none possible
Just pnpm i
to install all dependencies and then pnpm t
to run the tests!