K
K
kolomiec_artiom2019-02-19 18:30:31
Python
kolomiec_artiom, 2019-02-19 18:30:31

Is there a universal algorithm for the problems 'Is it possible to shift 1 matchstick so that the equality becomes true'?

Good evening. The task is:
An expression is given. For example: 9 = 6 (from matches)
Is it possible to get the correct expression by shifting one list?
How to do it programmatically?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2019-02-19
@jcmvbkbc

How to do it programmatically?

Find all possible positions in which to put the match. Find all admissible figures from matches. Print the value of each valid shape and each combination of valid shapes. Go through all the matches, shift each match into all possible positions, check if all the formed figures and their combination are admissible and calculate the value of the resulting expression. Sounds simple, doesn't it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question