Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sabareeshwaran/leaders in a python #3527

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

sabareeshwaran-sureshkumar

I have solved the leaders in a array.the issue number of the problem is 3321

In computer programming, an array is a collection of elements of the same data type, stored in contiguous memory locations, and accessed using an index or a subscript. A leader in an array is an element that is greater than all the elements in the array.

To find the leaders in an array, we can start iterating through the array from the right end and keep track of the maximum element seen so far. If the current element is greater than the maximum element seen so far, it is a leader, and we add it to a list of leaders. We continue this process until the leader is found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant