diff options
Diffstat (limited to 'challenge-289')
| -rw-r--r-- | challenge-289/conor-hoekstra/ch-1.bqn | 9 | ||||
| -rw-r--r-- | challenge-289/conor-hoekstra/ch-2.bqn | 10 |
2 files changed, 19 insertions, 0 deletions
diff --git a/challenge-289/conor-hoekstra/ch-1.bqn b/challenge-289/conor-hoekstra/ch-1.bqn new file mode 100644 index 0000000000..e24347760c --- /dev/null +++ b/challenge-289/conor-hoekstra/ch-1.bqn @@ -0,0 +1,9 @@ +# For up to date code: +# https://github.com/codereport/bqn-code/blob/main/pwc/289-1.bqn + +ThirdMaximum ← 2⊑((2⥊⌈´)∾˜⍷∘∨) + +# Tests +•Show ThirdMaximum ⟨5, 6, 4, 1⟩ # 4 +•Show ThirdMaximum ⟨4, 5⟩ # 5 +•Show ThirdMaximum ⟨1, 2, 2, 3⟩ # 1 diff --git a/challenge-289/conor-hoekstra/ch-2.bqn b/challenge-289/conor-hoekstra/ch-2.bqn new file mode 100644 index 0000000000..b1f1b9a211 --- /dev/null +++ b/challenge-289/conor-hoekstra/ch-2.bqn @@ -0,0 +1,10 @@ +# For up to date code: +# https://github.com/codereport/bqn-code/blob/main/pwc/289-2.bqn + +⟨Words, Unwords⟩ ⇐ •Import "../lib/string.bqn" + +Shuffle ← •rand.Deal∘≠⊸⊏ +Jumble ← Unwords·Shuffle⌾(¯1↓1↓⊢)¨Words + +# Tests +•Show Jumble "This is a bunch a text that should be jumbled" |
