From a2ee72e7164316602354c734c4b917dead61683e Mon Sep 17 00:00:00 2001 From: Vasko Zdravevski Date: Tue, 11 Sep 2018 15:04:24 -0600 Subject: [PATCH] instead of 'current' use 'active' --- day21/problem.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/day21/problem.go b/day21/problem.go index deb24c0..cb9d6d6 100644 --- a/day21/problem.go +++ b/day21/problem.go @@ -25,15 +25,15 @@ func MinimumRooms(lectures []Lecture) int { sort.Slice(events, func(i, j int) bool { return events[i].time < events[j].time }) - var max, current int + var max, active int for i := range events { if events[i].starting { - current++ + active++ } else { - current-- + active-- } - if max < current { - max = current + if max < active { + max = active } } return max