Post History
Ruby, 75 bytes ->t,u{g=->a{a.reduce{-2*_1+_2}};('%b'%(g[t]+g[u]+(y=43690)^y)).to_i.digits} Try it online! Uses latest ruby features, so tio link will look different. Takes two digit a...
Answer
#3: Post edited
# [Ruby], 66 bytes- <!-- language-all: lang-ruby -->
->t,u{g=->a{a.reduce{-2*_1+_2}};eval '%b'%(g[t]+g[u]+(y=43690)^y)}[Try it online!][TIO-kqw1a56f]- [Ruby]: https://www.ruby-lang.org/
[TIO-kqw1a56f]: https://tio.run/##KypNqvyfZvtf165Ep7Q63VbXLrE6Ua8oNaU0ObW6pkKnskbXSKtCu7K21jq1LDFHQV01SV1VIz26JFY7Pbo0Vluj0tbE2MzSQDOuUrP2f4FCWnS0YaxOtEFsLBecY4jC0THUQcgCmcjyEK6OAVANsqAOHEMNgPGBBv0HAA- Uses latest ruby features, so tio link will look different.
Takes two digit arrays, and returns a string which represents the negabinary integer.- Borrows from a conversion technique used [here.](https://codegolf.stackexchange.com/a/113589/80214)
- # [Ruby], 75 bytes
- <!-- language-all: lang-ruby -->
- ->t,u{g=->a{a.reduce{-2*_1+_2}};('%b'%(g[t]+g[u]+(y=43690)^y)).to_i.digits}
- [Try it online!][TIO-kqwj007a]
- [Ruby]: https://www.ruby-lang.org/
- [TIO-kqwj007a]: https://tio.run/##KypNqvyfZvtf165Ep7Q63VbXLrE6Ua8oNaU0ObW6pkKnskbXSKtCu7K21lpDXTVJXVUjPbokVjs9ujRWW6PS1sTYzNJAM65SU1OvJD8@Uy8lMz2zpLj2f4FCWnS0YaxOtEFsLBecY4jC0THUQcgCmcjyEK6OAVANsqAOHEMNgPGBBv0HAA "Ruby – Try It Online"
- Uses latest ruby features, so tio link will look different.
- Takes two digit arrays, and returns an array which represents the negabinary integer.
- Borrows from a conversion technique used [here.](https://codegolf.stackexchange.com/a/113589/80214)
#2: Post edited
# [Ruby], 61 bytes- <!-- language-all: lang-ruby -->
->t,u{g=->a{a.reduce{-2*_1+_2}};'%b'%(g[t]+g[u]+(y=43690)^y)}- [Try it online!][TIO-kqw1a56f]
- [Ruby]: https://www.ruby-lang.org/
[TIO-kqw1a56f]: https://tio.run/##KypNqvyfZvtf165Ep7Q63VbXLrE6Ua8oNaU0ObW6pkKnskbXSKtCu7K21lpdNUldVSM9uiRWOz26NFZbo9LWxNjM0kAzrlKz9n@BQlp0tGGsTrRBbCwXnGOIwtEx1EHIApnI8hCujgFQDbKgDhxDDYDxgQb9BwA "Ruby – Try It Online"- Uses latest ruby features, so tio link will look different.
- Takes two digit arrays, and returns a string which represents the negabinary integer.
- Borrows from a conversion technique used [here.](https://codegolf.stackexchange.com/a/113589/80214)
- # [Ruby], 66 bytes
- <!-- language-all: lang-ruby -->
- ->t,u{g=->a{a.reduce{-2*_1+_2}};eval '%b'%(g[t]+g[u]+(y=43690)^y)}
- [Try it online!][TIO-kqw1a56f]
- [Ruby]: https://www.ruby-lang.org/
- [TIO-kqw1a56f]: https://tio.run/##KypNqvyfZvtf165Ep7Q63VbXLrE6Ua8oNaU0ObW6pkKnskbXSKtCu7K21jq1LDFHQV01SV1VIz26JFY7Pbo0Vluj0tbE2MzSQDOuUrP2f4FCWnS0YaxOtEFsLBecY4jC0THUQcgCmcjyEK6OAVANsqAOHEMNgPGBBv0HAA
- Uses latest ruby features, so tio link will look different.
- Takes two digit arrays, and returns a string which represents the negabinary integer.
- Borrows from a conversion technique used [here.](https://codegolf.stackexchange.com/a/113589/80214)
#1: Initial revision
# [Ruby], 61 bytes <!-- language-all: lang-ruby --> ->t,u{g=->a{a.reduce{-2*_1+_2}};'%b'%(g[t]+g[u]+(y=43690)^y)} [Try it online!][TIO-kqw1a56f] [Ruby]: https://www.ruby-lang.org/ [TIO-kqw1a56f]: https://tio.run/##KypNqvyfZvtf165Ep7Q63VbXLrE6Ua8oNaU0ObW6pkKnskbXSKtCu7K21lpdNUldVSM9uiRWOz26NFZbo9LWxNjM0kAzrlKz9n@BQlp0tGGsTrRBbCwXnGOIwtEx1EHIApnI8hCujgFQDbKgDhxDDYDxgQb9BwA "Ruby – Try It Online" Uses latest ruby features, so tio link will look different. Takes two digit arrays, and returns a string which represents the negabinary integer. Borrows from a conversion technique used [here.](https://codegolf.stackexchange.com/a/113589/80214)