Skip to content

Issue: Largest Series Product #305

Open
@blueglyph

Description

@blueglyph

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

    @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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue: requires investigationThis issue requires further investigation from maintainers.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions