Skip to content

[BUG] SumOfSquares accepts negative input #7538

Description

@oozan

Description

SumOfSquares.minSquares currently returns 3 for negative inputs even though negative integers cannot be represented as sums of integer squares.

Expected behavior

The method should reject negative input with IllegalArgumentException.

Reproduction

Calling SumOfSquares.minSquares(-1) currently returns 3 instead of reporting invalid input.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions