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 cdd5cf9 commit 6d27d52Copy full SHA for 6d27d52
0437_Problem_1.bqn
@@ -0,0 +1,16 @@
1
+# For up to date code:
2
+# https://github.com/codereport/bqn-code/blob/main/leetcode/437-1.bqn
3
+
4
+# Link: https://leetcode.com/problems/find-special-substring-of-length-k
5
6
+u ⇐ •Import "/home/cph/bqn-test/test.bqn"
7
+fn ⇐ •Import "/home/cph/bqn-code/lib/fun.bqn"
8
9
+HasSpecialSubstring ← { ∨´𝕨=≠¨fn.Group𝕩 } # Explicit
10
+HasSpecialSubstring2 ← ∨´=⟜(≠¨fn.Group) # Tacit
11
12
+# Tests
13
+u.UnitTest (3 HasSpecialSubstring "aaabaaa") ≡ 1
14
+u.UnitTest (2 HasSpecialSubstring "abc") ≡ 0
15
+u.UnitTest (3 HasSpecialSubstring2 "aaabaaa") ≡ 1
16
+u.UnitTest (2 HasSpecialSubstring2 "abc") ≡ 0
0 commit comments