Skip to content

Commit f1de19e

Browse files
committed
✨ lc 443-1 & 2
1 parent 4c3eec6 commit f1de19e

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

0443_Problem_1.bqn

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# For up to date code:
2+
# https://github.com/codereport/bqn-code/blob/main/leetcode/443-1.bqn
3+
4+
# Link: https://leetcode.com/problems/minimum-cost-to-reach-every-position
5+
6+
u•Import "/home/cph/bqn-test/test.bqn"
7+
8+
MinCosts`
9+
10+
# Tests
11+
u.UnitTest (MinCosts5,3,4,1,3,2⟩) 5,3,3,1,1,1
12+
u.UnitTest (MinCosts1,2,4,6,7⟩) 1,1,1,1,1

0443_Problem_2.bqn

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# For up to date code:
2+
# https://github.com/codereport/bqn-code/blob/main/leetcode/443-2.bqn
3+
4+
# Link: https://leetcode.com/problems/minimum-cost-to-reach-every-position
5+
6+
u•Import "/home/cph/bqn-test/test.bqn"
7+
8+
LongestPalindrome ← { ´(≡×≠)¨𝕩(··¨)𝕨 } # Explicit
9+
LongestPalindrome2´·(≡×≠)¨·⥊∾⌜˜(·¨) # Tacit
10+
11+
# Tests
12+
u.UnitTest ( "a" LongestPalindrome "a" ) 2
13+
u.UnitTest ( "def" LongestPalindrome "abc" ) 1
14+
u.UnitTest ( "aaaa" LongestPalindrome "b" ) 4
15+
u.UnitTest ("ecdba" LongestPalindrome "abcde") 5
16+
u.UnitTest ( "a" LongestPalindrome2 "a" ) 2
17+
u.UnitTest ( "def" LongestPalindrome2 "abc" ) 1
18+
u.UnitTest ( "aaaa" LongestPalindrome2 "b" ) 4
19+
u.UnitTest ("ecdba" LongestPalindrome2 "abcde") 5

0 commit comments

Comments
 (0)