Post History
Python 3.8 (pre-release), 106 95 bytes Saved 11 bytes thanks to Peter Taylor! f=lambda m:sum((-1)**i*x*f([r[:i]+r[i+1:]for r in m[1:]])for i,x in enumerate(m[0]))if m else 1 Try it online! ...
Answer
#2: Post edited
# [Python 3.8 (pre-release)], 106 bytes- <!-- language-all: lang-python -->
f=lambda m:sum((-1)**i*m[0][i]*f([r[:i]+r[i+1:]for r in m[1:]])for i in range(len(m)))if m[1:]else m[0][0][Try it online!][TIO-ksuxrhvd]- [Python 3.8 (pre-release)]: https://docs.python.org/3.8/
[TIO-ksuxrhvd]: https://tio.run/##dc3LDoIwEAXQPV/RxE2LU9JSkEeiP9J0gRG0CS2k4MKvr8VHwIWryc2c3Ds@5ttgRTk677tj35jzpUGmnu4GY8pJHOvYSKakVnGHpZO1Vnsn9Z7XqhscckhbZGRIiixZL9k19trivrXYEEJ09wZtP7Xo1cWUH522Mw6NkgNTIBnw0EDQDtET4tHmneSQBkAFZEm@MWlS5BsnoAiKA81WQ3kV/Qx9pz73/yikIALJIIdDuAWUUK2U@Sc "Python 3.8 (pre-release) – Try It Online"Here's an attempt at beating Quintec's answer. Only 78 more bytes to go!
- # [Python 3.8 (pre-release)], <s>106</s> 95 bytes
- Saved 11 bytes thanks to Peter Taylor!
- <!-- language-all: lang-python -->
- f=lambda m:sum((-1)**i*x*f([r[:i]+r[i+1:]for r in m[1:]])for i,x in enumerate(m[0]))if m else 1
- [Try it online!][TIO-kvx1eo2g]
- [Python 3.8 (pre-release)]: https://docs.python.org/3.8/
- [TIO-kvx1eo2g]: https://tio.run/##dY3LCoMwEEX3fsVAN4mdiFFTH9D@SMjC0kgDRiUq2K@3EVq0i64ud@bMnOE1PfsuLQa3rs21re39UYOtxtkSwjgNQxMuYUOkk5VRZyfNmVeq6R04MB1Y6ZuiWze4bBPdzVa7etLEylhRahqwoNtRA18HZ7qJ@GeSY6xQxsj9MYUTsBvw4LCOBCYeYClmkTgwSZSLA5di7imOLNsZxsvgR/RVffK/FBNMPZKhwIvPHAssdzRe3w "Python 3.8 (pre-release) – Try It Online"
- Here's an attempt at beating Quintec's answer. Only <s>78</s> 67 more bytes to go!
#1: Initial revision
# [Python 3.8 (pre-release)], 106 bytes <!-- language-all: lang-python --> f=lambda m:sum((-1)**i*m[0][i]*f([r[:i]+r[i+1:]for r in m[1:]])for i in range(len(m)))if m[1:]else m[0][0] [Try it online!][TIO-ksuxrhvd] [Python 3.8 (pre-release)]: https://docs.python.org/3.8/ [TIO-ksuxrhvd]: https://tio.run/##dc3LDoIwEAXQPV/RxE2LU9JSkEeiP9J0gRG0CS2k4MKvr8VHwIWryc2c3Ds@5ttgRTk677tj35jzpUGmnu4GY8pJHOvYSKakVnGHpZO1Vnsn9Z7XqhscckhbZGRIiixZL9k19trivrXYEEJ09wZtP7Xo1cWUH522Mw6NkgNTIBnw0EDQDtET4tHmneSQBkAFZEm@MWlS5BsnoAiKA81WQ3kV/Qx9pz73/yikIALJIIdDuAWUUK2U@Sc "Python 3.8 (pre-release) – Try It Online" Here's an attempt at beating Quintec's answer. Only 78 more bytes to go!