diff options
| author | Mohammad Sajid Anwar <Mohammad.Anwar@yahoo.com> | 2025-11-10 00:01:51 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-10 00:01:51 +0000 |
| commit | 97d7db3566f084960caf7e4bfc86f8a80e5988a3 (patch) | |
| tree | 569bffb80497a6e9cae881b80d41926f50506d77 | |
| parent | f8056dd1ca6db3763a3657312fe52e66cf007e17 (diff) | |
| parent | d53116df72c8b05d44b5ead55a2d970201520d34 (diff) | |
| download | perlweeklychallenge-club-97d7db3566f084960caf7e4bfc86f8a80e5988a3.tar.gz perlweeklychallenge-club-97d7db3566f084960caf7e4bfc86f8a80e5988a3.tar.bz2 perlweeklychallenge-club-97d7db3566f084960caf7e4bfc86f8a80e5988a3.zip | |
Merge pull request #12999 from pyjail/master
Week 346 in Uiua
| -rw-r--r-- | challenge-346/orthoplex/uiua/ch-1.ua | 11 | ||||
| -rw-r--r-- | challenge-346/orthoplex/uiua/ch-2.ua | 18 |
2 files changed, 29 insertions, 0 deletions
diff --git a/challenge-346/orthoplex/uiua/ch-1.ua b/challenge-346/orthoplex/uiua/ch-1.ua new file mode 100644 index 0000000000..0b037823c3 --- /dev/null +++ b/challenge-346/orthoplex/uiua/ch-1.ua @@ -0,0 +1,11 @@ +# uiua 0.17.2 + +LongestParenthesis ← ⬚0/↥˙⊜⧻±⍥⍜(regex"\\(A*\\)"|↥@A)∞ + +┌─╴test + ⍤⤙≍6 LongestParenthesis "(()())" + ⍤⤙≍4 LongestParenthesis ")()())" + ⍤⤙≍8 LongestParenthesis "((()))()(((()" + ⍤⤙≍2 LongestParenthesis "))))((()(" + ⍤⤙≍2 LongestParenthesis "()(()" +└─╴ diff --git a/challenge-346/orthoplex/uiua/ch-2.ua b/challenge-346/orthoplex/uiua/ch-2.ua new file mode 100644 index 0000000000..9a3085dcc0 --- /dev/null +++ b/challenge-346/orthoplex/uiua/ch-2.ua @@ -0,0 +1,18 @@ +# uiua 0.17.2 + +MagicExpression ← ( + ⧅⋅⧻⊙{@*@+@-""}-₁⊸⧻ # separator combinations + ⍚⌟(/◇⊂♭⍉⊟⊂□"") # interleave + ▽⊸≡◇(≍⊸⍚⍜⋕∘⊜□⊸≥@0) # leading zeros + ˜▽⊙=⟜≡◇(/+⊕(/×⊜⋕⊸≠@*)\+⊸∊"-+") # eval +) + +┌─╴test + ⍤⤙≍{"1*2*3" "1+2+3"} MagicExpression "123" 6 + ⍤⤙≍{"1*0+5" "10-5"} MagicExpression "105" 5 + ⍤⤙≍{"2*3+2" "2+3*2"} MagicExpression "232" 8 + ⍤⤙≍{"1*2*3+4" "1+2+3+4"} MagicExpression "1234" 10 + ⍤⤙≍{"1+0*0+1" "1+0+0+1" "1+0-0+1" + "1-0*0+1" "1-0+0+1" "1-0-0+1" + } MagicExpression "1001" 2 +└─╴ |
