From 608882c40389fc8a71b61341bc3c409d2024d617 Mon Sep 17 00:00:00 2001 From: Mohammad S Anwar Date: Sat, 29 May 2021 21:18:58 +0100 Subject: - Added APL solutions by Richard Park. --- challenge-114/richard-park/apl/ch-1.aplf | 1 + challenge-114/richard-park/apl/ch-2.aplf | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 challenge-114/richard-park/apl/ch-1.aplf create mode 100644 challenge-114/richard-park/apl/ch-2.aplf diff --git a/challenge-114/richard-park/apl/ch-1.aplf b/challenge-114/richard-park/apl/ch-1.aplf new file mode 100644 index 0000000000..c6951f9c12 --- /dev/null +++ b/challenge-114/richard-park/apl/ch-1.aplf @@ -0,0 +1 @@ +NextPalindromeNumber←{(⊢≡⌽)⍕⍵:⍵ ⋄ ∇ ⍵+1} \ No newline at end of file diff --git a/challenge-114/richard-park/apl/ch-2.aplf b/challenge-114/richard-park/apl/ch-2.aplf new file mode 100644 index 0000000000..23761cf55a --- /dev/null +++ b/challenge-114/richard-park/apl/ch-2.aplf @@ -0,0 +1,7 @@ + HigherIntegerSetBits←{ + n←⍵+1 ⍝ Next integer + (sb nb)←+⌿2⊥⍣¯1⊢⍵,n ⍝ Set Bits, Next Bits + ⍺←sb ⍝ Fix set bits for recursion + ⍺=nb:n ⍝ Found, return result + ⍺ ∇ n ⍝ Try next number + } \ No newline at end of file -- cgit