Back to Amazon
Amazon logo

Coding rounds

Amazon coding rounds

5 timed coding challenges drawn from real loops. Submit a solution to see your test pass rate and AI feedback.

All coding rounds
beginner 30:00+50 XP

Valid Parentheses

Given a string `s` containing only the characters `()[]{}`, determine if the input string is valid. Brackets must close in the correct order and every opening bracket has a matching closing bracket of the same type. Use a stack.

Examples

  • all matched

    in: s="()[]{}"

    out: true

  • mismatched types

    in: s="(]"

    out: false

javascript
Loading editor...