TheAlgorithms / JavaScript

Algorithms and Data Structures implemented in JavaScript for beginners, following best practices.

Home Page:https://the-algorithms.com/language/javascript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SecondLargestElement Algorithm returns wrong value

Ankush263 opened this issue · comments

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

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

Should I make a PR

Should I make a PR

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