Remi-Leblond/S99 — comment on commit 5476124d708c40b1574dbf0b4322103a86979b91
File: src/S1.scala line 39
By LannyRipple:

Consider

```scala
def kThList[A](xs: List[A], k: Int): A = {
require(xs.nonEmpty, "empty list")
require(k > 0, "k <= 0")
if (k == 1) xs.head else kThList(xs.tail, k-1)
}
```

Not all that great but usually for internal code you can ignore requirements checking (that should have been done where external information enters the system) and you can reduce to

```scala
def kThList[A](xs: List[A], k: Int): A = if (k == 1) xs.head else kThList(xs.tail, k-1)
```

In the def you wrote you really didn't need the match{} because you weren't using any of the destructured information.