Skip to content

SecondLargestElement Algorithm returns wrong value #1035

Closed

Description

@Ankush263

for the array [-1, -2, -3, -4] it returns 0

Activity

  1. changed the title [-]fix SecondLargestElement Algorithm[/-] [+]SecondLargestElement Algorithm returns wrong value[/+] on Jun 3, 2022
  2. appgurueu commented on Jun 3, 2022

    @appgurueu
    Collaborator

    I assume the algorithm just wasn't intended to support negative values as it uses 0 as a default min value.

  3. Ankush263 commented on Jun 3, 2022

    @Ankush263
    ContributorAuthor

    Should I make a PR

  4. appgurueu commented on Jun 3, 2022

    @appgurueu
    Collaborator

    Should I make a PR

    I've already fixed it, see the linked PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions