Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 803dd79

Browse files
committed
day 20
1 parent 60f3baa commit 803dd79

File tree

8 files changed

+3263
-1
lines changed

8 files changed

+3263
-1
lines changed

2020/day18/main.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
PARENTH = /[\(\)]+/
1111

1212
def calc(str, prio)
13-
str.sub!(SINGLE_OP) { |a| calc(a.gsub(PARENTH,''), prio) } while str.include?('(')
13+
str.sub!(SINGLE_OP) { |a| calc(a.gsub(PARENTH, ''), prio) } while str.include?('(')
1414
prio.each { |r| str.sub!(r) { |a| eval(a) } while str.match(r) }
1515
str.to_i
1616
end

0 commit comments

Comments
 (0)