Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Post History

60%
+1 −0
Challenges Longest Increasing Subsequence

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...

posted 4y ago by Razetime‭  ·  edited 4y ago by Razetime‭

Answer
#2: Post edited by user avatar Razetime‭ · 2020-11-30T10:56:49Z (almost 4 years ago)
  • # [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
  • # [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 by user avatar Razetime‭ · 2020-11-30T07:10:39Z (almost 4 years ago)
# [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