Post History
Haskell, 78 77 bytes (g[0]!) g a=mapM(\_->[-1..1])a++g(0:a) (a:b)!c|foldl1((+).(*3))a==c=a|0<1=b!c Try it online!
Answer
#2: Post edited
# [Haskell], 78 bytes- <!-- language-all: lang-hs -->
(!)$g[0]g a=mapM(\a->[-1..1])a++g(0:a)- (a:b)!c|foldl1((+).(*3))a==c=a|0<1=b!c
[Try it online!][TIO-kt6zhws7]- [Haskell]: https://www.haskell.org/
[TIO-kt6zhws7]: https://tio.run/##FcyxDsIgEADQna8A43AngUBsHYx0cdXJUR1OpGhEbCxufruo41vehcZbSKn27lBB4DTuzZFFTu5OwxYOpLq9slrbI5KUEcySkAEtTyj8u3@kc7IAEjXM5ojknHf0NivrTsLXO10zdzyGsn7kEnIZedc5/o85DK@yK89N1j8CTJSREyF@j7SIutfPQGfU6ZrDWFu2YNayRctU0zDVNubj@0RxrMoPwxc "Haskell – Try It Online"
- # [Haskell], <del>78</del> 77 bytes
- <!-- language-all: lang-hs -->
- (g[0]!)
- g a=mapM(\_->[-1..1])a++g(0:a)
- (a:b)!c|foldl1((+).(*3))a==c=a|0<1=b!c
- [Try it online!][TIO-kt8ybjx0]
- [Haskell]: https://www.haskell.org/
- [TIO-kt8ybjx0]: https://tio.run/##FcyxDsIgEADQna8ApzsJBGLrYKSLq06OasyJFI2IjcXNbxd1fMu70HgLKdXe7SvEnTkIZJGTu9Owgf1RdTtltbYHJCkjmAUhA1qcUPh3/0jnZAEkapjOEMk57@htltadhK93umbueAxl9cgl5DLyrnP8H3MYXmVbnuusfwSYKCMnQvweaRF1r5@BzqjTNYexGtayObOWzVummoaptjEf3yeKY1V@GL4 "Haskell – Try It Online"
#1: Initial revision
# [Haskell], 78 bytes <!-- language-all: lang-hs --> (!)$g[0] g a=mapM(\a->[-1..1])a++g(0:a) (a:b)!c|foldl1((+).(*3))a==c=a|0<1=b!c [Try it online!][TIO-kt6zhws7] [Haskell]: https://www.haskell.org/ [TIO-kt6zhws7]: https://tio.run/##FcyxDsIgEADQna8A43AngUBsHYx0cdXJUR1OpGhEbCxufruo41vehcZbSKn27lBB4DTuzZFFTu5OwxYOpLq9slrbI5KUEcySkAEtTyj8u3@kc7IAEjXM5ojknHf0NivrTsLXO10zdzyGsn7kEnIZedc5/o85DK@yK89N1j8CTJSREyF@j7SIutfPQGfU6ZrDWFu2YNayRctU0zDVNubj@0RxrMoPwxc "Haskell – Try It Online"