Skip to content

Commit 78c4b7c

Browse files
committed
2024-01-25 v. 4.1.5: updated "1496. Path Crossing"
1 parent f6bd8b2 commit 78c4b7c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/easy/1496_path_crossing.rb

+2-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ def is_path_crossing(path)
1313
points = { '0,0' => true }
1414
x = 0
1515
y = 0
16-
(0...path.length).each do |i|
17-
move = path[i]
18-
directions = steps[move]
16+
path.each_char do |c|
17+
directions = steps[c]
1918
x += directions.first
2019
y += directions.last
2120
key = "#{x},#{y}"

0 commit comments

Comments
 (0)