- #1
uzi kiko
- 22
- 3
Hi
We have a family game when we are stuck in traffic similar to https://en.wikipedia.org/wiki/Countdown_(game_show)
(I know I am a nerd )
In the game we are looking at license plate of the car in front and trying to get 120 using the 4 arithmetic operators (+-*/) and the numbers in the license plate in the same order as they appear there.
For example:
If the license plate is 212614
2+1+2*6*1*4=120.
Obviously there is no solution for all the plates, but I would like to write a small program to find the solution (if exist) to check myself.
I can write a brute force algorithm that will go through all the options, but I wonder if there is a better algorithm.
Can you suggest a better solution?
We have a family game when we are stuck in traffic similar to https://en.wikipedia.org/wiki/Countdown_(game_show)
(I know I am a nerd )
In the game we are looking at license plate of the car in front and trying to get 120 using the 4 arithmetic operators (+-*/) and the numbers in the license plate in the same order as they appear there.
For example:
If the license plate is 212614
2+1+2*6*1*4=120.
Obviously there is no solution for all the plates, but I would like to write a small program to find the solution (if exist) to check myself.
I can write a brute force algorithm that will go through all the options, but I wonder if there is a better algorithm.
Can you suggest a better solution?
Last edited by a moderator: