Husk, 7 bytes +±Λ=2¹Σ Try it online! Input as a list.
posted 3y ago by Razetime
# [Husk], 7 bytes +±Λ=2¹Σ [Try it online!][TIO-ksumjufg] [Husk]: https://github.com/barbuz/Husk [TIO-ksumjufg]: https://tio.run/##yygtzv7/X/vQxnOzbY0O7Ty3@P///9FGOsaxAA "Husk – Try It Online" Input as a list.