#K38742. Valid Bracket Sequence

    ID: 26266 Type: Default 1000ms 256MiB

Valid Bracket Sequence

Valid Bracket Sequence

You are given a string \( s \) consisting solely of the characters '(', ')', '{', '}', '[' and ']'. Your task is to determine if the sequence of brackets is valid. A valid sequence satisfies the following criteria:

  • Every opening bracket has a corresponding closing bracket.
  • Brackets must be closed in the correct order.

For instance, the sequence () is valid while ([)] is not.

inputFormat

The input consists of a single line containing the string \( s \). It is guaranteed that \( s \) only contains the characters: '(', ')', '{', '}', '[' and ']'.

outputFormat

Output a single line containing either True if the sequence is valid or False if it is not.

## sample
()
True