Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BusiestBuildingTimes ¶
BusiestBuildingTimes returns the timestamp start and end when the building has the most people. Runs in O(N log N) time because it sorts the input by timestamp. Assumes building starts with 0 people and ends with 0 people.
Types ¶
type EnterOrExit ¶
type EnterOrExit string
EnterOrExit represents either entering the building or exiting.
const ( // Enter means people are entering the building. Enter EnterOrExit = "enter" // Exit means people are leaving the building. Exit EnterOrExit = "exit" )
type Movement ¶
type Movement struct { Timestamp uint64 Count int Type EnterOrExit }
Movement is an entry in the building's movement slice.
Click to show internal directories.
Click to hide internal directories.