3 ms·
I was given [1,2] in the second run. Even easier to see it's impossible.
by plg94 3y ago
I was given [1,2] in the second run. Even easier to see it's impossible.
- sour-taste 3y agoYeah the generation is very simple, 2-4 random numbers between 1 and 9 inclusive. Definitely gives impossible puzzles sometimes (because I don't know a general algorithm for generating possible ones only).
- hnfong 3y agoIf you only have numbers up to 9 an exhaustive search shouldn't be too bad (should be ~9! states if you memoize), you could implement a solver in Javascript and see whether a solution can be found before you give it to the user.