C0D1NG / Programming

39 stars 280 forks source link

💡 : Find the second largest in a list of numbers #324

Closed yozachar closed 3 years ago

yozachar commented 4 years ago

Problem Statement: Given a list of size l. Find the second largest number in that list. Come up with an effective method / algorithm.

Example:

list = [23, 51, 12, 19, 8]
2nd largest number = 23

Bonus: Find the nth largest or smallest number in a given list.

welcome[bot] commented 4 years ago

Congrats on creating your first Issue in the C0D1NG Organization! 🎉

mathewvarghesemanu commented 4 years ago

Added a python code snippet based on loops including comments.

yozachar commented 4 years ago

@mathewvarghesemanu, right here? as a solution?

mathewvarghesemanu commented 4 years ago

@mathewvarghesemanu, right here? as a solution?

No, in-branch number 389 named '#324'. I've raised a pull request. Please check, Thanks

DhruvSondhi commented 4 years ago

can i contribute to this issue in C++ if it is still open ?

yozachar commented 4 years ago

@mathewvarghesemanu needs some work: https://github.com/C0D1NG/Programming/pull/389#discussion_r499116835

@DhruvSondhi sure. I'm not a contributor yet, but I think @C0D1NG won't be displeased though.. :)

funwaa commented 4 years ago

Done in bash in #462 including the bonus, can find nth largest or smallest number in a list loaded from file