Skip to content

Instantly share code, notes, and snippets.

@sumew
Created November 26, 2020 05:57
Show Gist options
  • Save sumew/d6e82bd566f676f7be2a7a5156b6e6d7 to your computer and use it in GitHub Desktop.
Save sumew/d6e82bd566f676f7be2a7a5156b6e6d7 to your computer and use it in GitHub Desktop.
The state, holds the current window and the optimum (so far) window
case class State[Container](current: Window, best: Window, contained: Container) {
def lastIndex(): Int = current.r
def firstIndex(): Int = current.l
override def toString =
s"current: [${current.l}, ${current.r}], best: [${best.l}, ${best.r}], excess: ${contained}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment