- Rain Water
- Covered at 54:35 of C++Now 2019 - Algorithm Inutition
- Max Consecutive Ones (MCO)
- Link to Array Language Solutions
- Covered at 13:53 of GTC 2021 - Thrust and the C++ Standard Algorithms
- Covered in ADSP Episode 20: GTC 2021 Preview & Thrust Algorithms
- Covered in ADSP Episode 25: The Lost Reduction
- Longest Continuous Increasing Subsequence (LCIS)
- Link to Array Language Solutions
- Maximum Subarray Sum (Kadanes)
- Sushi for Two (SF2)
- Maximum Gap
- Link to Array Language Solutions
- Covered in ADSP Episode 115: Max Gap in C++23
- Maximum Gap Count
- Link to Array Language Solutions
- Covered in ADSP Episode 116: Max Gap Count in C++23
- Three Consecutive Odds
- Covered in ADSP Episode 119: Why APL & Haskell are AWESOME with Zach Laine! (Part 3)
- Tweet by Tristan Brindle covering various solutions
- Skyline
- Talked about in Why Would a Non-Programmer Learn APL? // Richard Savenije // APL Seeds '23
- Coverd at 12:12 of KX Con 2023 - Algorithms in q
- Covered in Episode 135: 🇸🇮 Slovenia 🇸🇮 2023 Road Trip!
- Ocean View
Problem | Algorithms Required | Combinators Required | |
---|---|---|---|
1 | Rain Water | reduce , map2 , scan |
phi , under |
2 | MCO | 1) reduce , scan 2) reduce , map , chunkBy |
1) phi1 2) - |
3 | LCIS | 1) reduce , scan , mapAdjacent 2) reduce , map , chunkBy |
1) phi1 2) - |
4 | Kadanes | reduce , scan |
phi1 |
5 | SF2 | reduce , mapAdjacent , map , chunkBy reduce , mapAdjacent , indices |
- |
6 | Max Gap | sort , mapAdjacent , reduce |
- |
7 | Max Gap Count | 1) sort , mapAdjacent , (RP* or map2 , repeat ) + reduce 2) sort , mapAdjacent , reduce 3) sort , foldl |
1) sigma or s 2) - 3) - |
8 | TCO | 1) slide , reduce 2) reduce , scan 3) reduce , map , chunkBy |
1) - 2) phi1 3) - |
9 | Skyline | 1) scan , unique |
- |
10 | OceanView | 1) reverse , scan , unique_mask , indices 2) reverse , scan , progressive_index_count , map , indices |
under ? |
* - Rank Polymorphism
Language | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
---|---|---|---|---|---|---|---|---|
BQN | ⭐✔️ | ⭐✔️ | ✔️ | ⭐✔️ | ✔️ | ⭐✔️ | ⭐✔️ | ✔️ |
Haskell | ✔️ | ✔️ | ⭐✔️ | ✔️ | ⭐✔️ | ✔️ | ✔️ | ✔️ |
APL | ✔️ | ✔️ | ✔️ | 🚫 | ✔️ | ✔️ | ✔️ | ⭐✔️ |
J | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
Clojure | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |
C++ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | |||
Smalltalk | ✔️ | |||||||
D | ✔️ |