Skip to content

Commit 613fcb9

Browse files
committed
✨ lc b148-1
1 parent 003bd10 commit 613fcb9

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

B0148_Problem_1.bqn

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# For up to date code:
2+
# https://github.com/codereport/bqn-code/blob/main/leetcode/b148-1.bqn
3+
4+
# Link: https://leetcode.com/problems/maximum-difference-between-adjacent-elements-in-a-circular-array
5+
6+
u•Import "/home/cph/bqn-test/test.bqn"
7+
fn•Import "/home/cph/bqn-code/lib/fun.bqn"
8+
9+
MaxAdjacentDistance´·|·fn.Deltas(1+≠) # Tacit
10+
MaxAdjacentDistance2 ← { ´|fn.Deltas𝕩˜1+≠𝕩 } # Explicit
11+
12+
# Tests
13+
u.UnitTest (MaxAdjacentDistance 124) 3
14+
u.UnitTest (MaxAdjacentDistance ¯5¯10¯5) 5
15+
u.UnitTest (MaxAdjacentDistance2 124) 3
16+
u.UnitTest (MaxAdjacentDistance2 ¯5¯10¯5) 5

0 commit comments

Comments
 (0)