SarthakKeshari / CPP-Questions-and-Solutions

This repository aims to solve and create new problems from different spheres of coding. A path to help students to get access to solutions and discuss their doubts.
MIT License
47 stars 132 forks source link

Next Greater Element (using Stack) #346

Closed Master-Helix closed 2 years ago

Master-Helix commented 2 years ago

Enter your question -

Given an array arr[ ] of size N having distinct elements, the task is to find the next greater element for each element of the array in order of their appearance in the array. Next greater element of an element in the array is the nearest element on the right which is greater than the current element. If there does not exist next greater of current element, then next greater element for current element is -1. For example, next greater of the last element is always -1.

Enter link to the question(if question belongs to any online platform) -

https://practice.geeksforgeeks.org/problems/next-larger-element-1587115620/1

Tags for the question(eg - Array, Basic, Stack, etc.) -

Array, Stack

Master-Helix commented 2 years ago

@SarthakKeshari sir, I want to contribute this question to your repository. Thank You

SarthakKeshari commented 2 years ago

@Master-Helix, Kindly add your solution to "GeeksForGeeks" folder. Deadline - 08/10/2021

satyam-mahajan commented 2 years ago

Hii,I am able to fix the issue in a optimal way. please assign it to me.

Master-Helix commented 2 years ago

@satyam-mahajan I haven't done it yet...so how can u compare with my code? πŸ€” Create your own issueπŸ˜‘

satyam-mahajan commented 2 years ago

I can write the code of Next Greater Element in c++.

Master-Helix commented 2 years ago

Are you newbie or something? @satyam-mahajan This repo is for C++ only πŸ˜… If u don't know how to contribute kindly see the tutorial..dont post unnecessary comments in other's issue

akshaygidwani404 commented 2 years ago

Hi @SarthakKeshari! Can you please assign me this task?

satyam-mahajan commented 2 years ago

@Master-Helix Actually I am beginner in open source.

Master-Helix commented 2 years ago

@satyam-mahajan , U have to create a new issue ( any specific question) rather than commenting here to assign. I am already working on this issue. Create your own issue or ask someone if they allow their issue to be done by you

Parul1923 commented 2 years ago

Hi Can you please assign this task to me?

SarthakKeshari commented 2 years ago

@Master-Helix, Kindly don't get into heated argument. Continue your work, everyone is allowed to comment on any issue. But I will take the final decision.

SarthakKeshari commented 2 years ago

@satyam-mahajan, @akshaygidwani404 and @Parul1923, Kindly check the deadline. Since the issue hasn't crossed the deadline so no one will be assigned the issue even after claiming it. You may head on and create your own issue. Refer CONTRIBUTING.md for futher details.

SarthakKeshari commented 2 years ago

@Master-Helix, This should not happen again. its a public platform generosity is appreciated.

SarthakKeshari commented 2 years ago

I hope my point is clear. I want all four of you to notify me here in the chat.

Master-Helix commented 2 years ago

@SarthakKeshari , I just want to clarify them that I was doing it already..if deadline has passed then they can be assigned. Its OK from my side..πŸ‘