diff options
| author | Conor Hoekstra <codereport@outlook.com> | 2024-09-20 23:35:22 -0400 |
|---|---|---|
| committer | Conor Hoekstra <codereport@outlook.com> | 2024-09-20 23:35:22 -0400 |
| commit | f5e94e61241e2fdf881635f0aee9a49db72e9d26 (patch) | |
| tree | 81c3fe391c7b6aa4dd825f7a8c1665f48b298ba9 /challenge-078 | |
| parent | 8cd710f7d2cf43e4997b1f5ac84ddfbdff798ac3 (diff) | |
| download | perlweeklychallenge-club-f5e94e61241e2fdf881635f0aee9a49db72e9d26.tar.gz perlweeklychallenge-club-f5e94e61241e2fdf881635f0aee9a49db72e9d26.tar.bz2 perlweeklychallenge-club-f5e94e61241e2fdf881635f0aee9a49db72e9d26.zip | |
:sparkles: Week 78 & 82 in BQN
Diffstat (limited to 'challenge-078')
| -rw-r--r-- | challenge-078/conor-hoekstra/ch-1.bqn | 8 | ||||
| -rw-r--r-- | challenge-078/conor-hoekstra/ch-2.bqn | 17 |
2 files changed, 25 insertions, 0 deletions
diff --git a/challenge-078/conor-hoekstra/ch-1.bqn b/challenge-078/conor-hoekstra/ch-1.bqn new file mode 100644 index 0000000000..54f55bf3f4 --- /dev/null +++ b/challenge-078/conor-hoekstra/ch-1.bqn @@ -0,0 +1,8 @@ +# For up to date code: +# https://github.com/codereport/bqn-code/blob/main/pwc/078-1.bqn + +LeaderElement ← ⍷⌈`⌾⌽ + +# Tests +•Show LeaderElement ⟨9, 10, 7, 5, 6, 1⟩ # ⟨10, 7, 6, 1⟩ +•Show LeaderElement ⟨3, 4, 5⟩ # ⟨5⟩ diff --git a/challenge-078/conor-hoekstra/ch-2.bqn b/challenge-078/conor-hoekstra/ch-2.bqn new file mode 100644 index 0000000000..7848e90a68 --- /dev/null +++ b/challenge-078/conor-hoekstra/ch-2.bqn @@ -0,0 +1,17 @@ +# For up to date code: +# https://github.com/codereport/bqn-code/blob/main/pwc/078-2.bqn + +LeftRotate ← >⌽¨⟜< + +# Tests + +•Show ⟨3,4⟩ LeftRotate ⟨10,20,30,40,50⟩ +# Output: +# [40 50 10 20 30] +# [50 10 20 30 40] + +•Show ⟨1,3,4⟩ LeftRotate ⟨7,4,2,6,3⟩ +# Output: +# [4 2 6 3 7] +# [6 3 7 4 2] +# [3 7 4 2 6] |
