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

Added POTD solution of 10th october #65

Merged
merged 3 commits into from
Oct 11, 2024
Merged

Conversation

horrible-hacker
Copy link
Contributor

🚀 What does this PR do?

  • Adds solution for LeetCode Daily Challenge on 10 October in C++.
  • To solve this problem I have used monotonic stack, i have taken all the elements from the left in a stack such that they follow this pattern i.e. nums[j]<stack.top() and after making this stack, i have started from right to start poping elements from the stack if they follow this condition i.e nums[j]>=stack.top(), if they do follow these condition then i pop that element from stack and also calculate j-i for that instance.

📝 Issue Reference:


Fixes issue: # 10

🔍 Checklist:

Please ensure the following before submitting your PR:

  • I have placed my solution in the correct folder (solutions/dayXX/).
  • [T] My code follows clean coding practices and is efficient.
  • I have added comments in my code to explain the approach.
  • I have updated the README.md for the specific day with a brief explanation of my solution.
  • [T] I have tested the solution on LeetCode and it works correctly.

🔧 Solution Details:

  • Language Used: C++
  • Time Complexity: O(N)
  • Space Complexity: O(N)

🌟 Additional Notes (if any):

Screenshot of above Solution

Screenshot 2024-10-11 at 10 49 41 PM

Added solution of POTD of 10 October in C++
Moved Soltuion.cpp from day 10 to day 9
@horrible-hacker
Copy link
Contributor Author

I have also moved solution.cpp file from day10 folder to day09 folder.

@arya2004 arya2004 merged commit 493902b into arya2004:main Oct 11, 2024
1 check passed
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.

2 participants