Post History
Husk, 10 bytes L►LfΛo<0-Ṗ Try it online! Explanation L►LfΛo<0-Ṗ Ṗ power set of input f get elements which match the following: Λo - all pairwise difference...
Answer
#2: Post edited
# [Husk], 9 bytesLḟΛo<0-↔Ṗ[Try it online!][TIO-ki47o35z]- [Husk]: https://github.com/barbuz/Husk
[TIO-ki47o35z]: https://tio.run/##ASIA3f9odXNr//9M4bifzptvPDAt4oaU4bmW////WzEsNSwyLDRd "Husk – Try It Online"- ## Explanation
- ```
LḟΛo<0-↔ṖṖ power set of input↔ reverse(decreasing order of length)ḟ get first element which matches the following:Λo - all pairwise differences<0 are negativeL take its length
- # [Husk], 10 bytes
- L►LfΛo<0-Ṗ
- [Try it online!][TIO-ki4frvc8]
- [Husk]: https://github.com/barbuz/Husk
- [TIO-ki4frvc8]: https://tio.run/##yygtzv7/3@fRtF0@aedm59sY6D7cOe3////R5jqGOpY6xjoWOqY6JjpmOkaxAA "Husk – Try It Online"
- ## Explanation
- ```
- L►LfΛo<0-Ṗ
- Ṗ power set of input
- f get elements which match the following:
- Λo - all pairwise differences
- <0 are negative
- ►L max by length
- L length of that
#1: Initial revision
# [Husk], 9 bytes LḟΛo<0-↔Ṗ [Try it online!][TIO-ki47o35z] [Husk]: https://github.com/barbuz/Husk [TIO-ki47o35z]: https://tio.run/##ASIA3f9odXNr//9M4bifzptvPDAt4oaU4bmW////WzEsNSwyLDRd "Husk – Try It Online" ## Explanation ``` LḟΛo<0-↔Ṗ Ṗ power set of input ↔ reverse(decreasing order of length) ḟ get first element which matches the following: Λo - all pairwise differences <0 are negative L take its length