We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d4ba2f commit 1a45747Copy full SHA for 1a45747
B0149_Problem_1.bqn
@@ -0,0 +1,15 @@
1
+# For up to date code:
2
+# https://github.com/codereport/bqn-code/blob/main/leetcode/b149-1.bqn
3
+
4
+# Link: https://leetcode.com/problems/find-valid-pair-of-adjacent-digits-in-string
5
6
+u ⇐ •Import "/home/cph/bqn-test/test.bqn"
7
+fn ⇐ •Import "/home/cph/bqn-code/lib/fun.bqn"
8
9
+# TODO improve
10
+FindValidPair ← { ×∘≠◶⟨⊢,∾·•Fmt¨⊑⟩<˘≠´˘⊸/(∧´˘0⊸≠)⊸/2↕(-⟜'0'(⊣×=)(+´˘=⌜˜))𝕩 }
11
12
+# Tests
13
+u.UnitTest (FindValidPair "2523533") ≡ "23"
14
+u.UnitTest (FindValidPair "221") ≡ "21"
15
+u.UnitTest (FindValidPair "22") ≡ ""
0 commit comments