Skip to content

Commit

Permalink
instead of 'current' use 'active'
Browse files Browse the repository at this point in the history
  • Loading branch information
vaskoz committed Sep 11, 2018
1 parent 6ed148d commit a2ee72e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions day21/problem.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a2ee72e

Please sign in to comment.