Bracket Match 2015/12/14 14368 #!/usr/bin/env perl6 use v6; my \stdin = $*IN; my Int $count = +stdin.get(); for ^$count { my Str $str = stdin.get(); while $str.chars > 0 { last unless $str ~~ s:g/[ \[ \] || \( \) ]+//; } say $str.chars ?? "No" !! "Yes"; }