Skip to content

Conversation

@manikonda-anjali
Copy link

Description

This pull request adds a Python implementation of the Valid Parentheses algorithm.
The algorithm checks whether a given string of brackets is valid, ensuring that every opening bracket has a corresponding closing bracket in the correct order.

Changes Made

  • Added a new file: algorithms/valid-parentheses.py
  • Implemented a clean and efficient solution using a stack-based approach.
  • Included example test cases in code comments for clarity.

Example

Input:
"()[]{}"
Output:
True

Input:
"(]"
Output:
False

Checklist

  • Code follows the repository’s style guidelines.
  • Code is properly formatted and readable.
  • Implementation has been tested locally.
  • New file is placed in the correct directory (algorithms/).
  • Commit message is descriptive.

Additional Notes

This implementation is intended for educational purposes as part of the open-source Algorithms in Python collection. It provides a clear example of stack usage in validating expressions.

@algorithms-keeper algorithms-keeper bot added the tests are failing Do not merge until tests pass label Nov 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests are failing Do not merge until tests pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant