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:
Created | Jan 15, 2015 |
Warriors Trained | 22188 |
Total Skips | 5724 |
Total Code Submissions | 60731 |
Total Times Completed | 7129 |
Python Completions | 1989 |
Java Completions | 1948 |
JavaScript Completions | 1972 |
C# Completions | 782 |
Ruby Completions | 504 |
Haskell Completions | 197 |
Total Stars | 408 |
% of votes with a positive feedback rating | 90% of 893 |
Total "Very Satisfied" Votes | 736 |
Total "Somewhat Satisfied" Votes | 144 |
Total "Not Satisfied" Votes | 13 |