Retired

Checking Groups (retired)

1,989 of 7,129JS01

Description:

In English and programming, groups can be made using symbols such as () and {} that change meaning. However, these groups must be closed in the correct order to maintain correct syntax.

Your job in this kata will be to make a program that checks a string for correct grouping. For instance, the following groups are done correctly:

({})
[[]()]
[{()}]

The next are done incorrectly:

{(})
([]
[])

A correct string cannot close groups in the wrong order, open a group but fail to close it, or close a group before it is opened.

Your function will take an input string that may contain any of the symbols (), {} or [] to create groups.

It should return True if the string is empty or otherwise grouped correctly, or False if it is grouped incorrectly.

Algorithms
Data Structures
Strings
Data Types

Similar Kata:

Stats:

CreatedJan 15, 2015
Warriors Trained22188
Total Skips5724
Total Code Submissions60731
Total Times Completed7129
Python Completions1989
Java Completions1948
JavaScript Completions1972
C# Completions782
Ruby Completions504
Haskell Completions197
Total Stars408
% of votes with a positive feedback rating90% of 893
Total "Very Satisfied" Votes736
Total "Somewhat Satisfied" Votes144
Total "Not Satisfied" Votes13
Ad
Contributors
  • JS01 Avatar
  • jhoffner Avatar
  • junyuecao Avatar
  • GiacomoSorbi Avatar
  • FrankyS Avatar
  • anter69 Avatar
  • bse Avatar
  • Blind4Basics Avatar
  • solitude Avatar
Ad