Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4319b47

Browse filesBrowse files
committed
Add day 21
1 parent 979fe27 commit 4319b47
Copy full SHA for 4319b47

File tree

1 file changed

+2
-2
lines changed
Filter options

1 file changed

+2
-2
lines changed

‎2024/21/21.py

Copy file name to clipboardExpand all lines: 2024/21/21.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ def path(start, end):
1010
pad = N if (start in N and end in N) else R
1111
diff = pad[end] - pad[start]
1212
dx, dy = int(diff.real), int(diff.imag)
13-
yy = ("^" if dy < 0 else "v") * abs(dy)
14-
xx = ("<" if dx < 0 else ">") * abs(dx)
13+
yy = ("^"*-dy) + ("v"*dy)
14+
xx = ("<"*-dx) + (">"*dx)
1515

1616
if pad[start] + dy*1j == pad[" "]:
1717
return xx + yy + "A"

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.