exercism / exercism/kotlin

Issue: Largest Series Product

Open
#305 2 comments 0 reactions 0 assignees View on GitHub
issue: requires investigation
Dominant language
Kotlin
Stars
249
Forks
204
PR merge metrics
No merged PRs in 30d

Description

In this exercise, there are two tests which don't seem to be correct:

```kotlin
@Test
fun reports1ForEmptyStringAndEmptyProduct() {
assertEquals(1, Series("").getLargestProduct(0))
}


@Test
fun reports1ForNonEmptyStringAndEmptyProduct() {
assertEquals(1, Series("123").getLargestProduct(0))
}

```

The requirement is: _Given a string of digits, calculate the largest product for a contiguous substring of digits of length n._

Is it logical to return the value 1 when the arguments don't allow to find a solution? It looks like those two tests should return an `IllegalArgumentException`:

- first case: contradicts _Given a string of digits_
- second case: contradicts _substring of digits of length n_

If this is indeed what the exercise should be, then it should be specified explicitly IMHO.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.