paren matching

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Closing parentheses, brackets, and curly braces have been replaced with '?'. Match them back together.

Options

exec is denied

now post-mortem time, all source codes will be revealed

Sample input:_

(a [b {c d? e? f?
({([{[g??????
(hi [jk? [lm? no?
[{pqr (st? uvw??

Sample output:

(a [b {c d} e] f)
({([{[g]}])})
(hi [jk] [lm] no)
[{pqr (st) uvw}]

Sample input:_

( [ + $ - % ? { = / * & ? ?
* + / " ( , . ? { ? [ ; : ?
(? [? {? (? [? {?
((([[[((([[[((([[[((([[[
????????????{{{???????????????

Sample output:

( [ + $ - % ] { = / * & } )
* + / " ( , . ) { } [ ; : ]
() [] {} () [] {}
((([[[((([[[((([[[((([[[
]]])))]]]))){{{}}}]]])))]]])))

Sample input:_

(abcd [efgh {ijkl
(mnop [qrst {uvwx
{[(
? ? ? ? ?
 ? ? ? ?

Sample output:

(abcd [efgh {ijkl
(mnop [qrst {uvwx
{[(
) ] } } ]
 ) } ] )

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1yvl550.10302012/05/15 20:20:140B / 18B / 37B
2leonid560.09662012/05/16 04:53:430B / 19B / 37B
3kaki570.06422012/05/04 01:14:480B / 22B / 33B
4clock600.06242012/05/03 14:14:410B / 15B / 44B

Perl _

RankUserSizeTimeDateStatistics
1tybalt89420.08622012/05/04 13:09:430B / ?B / ?B
2test1480.09272012/05/04 02:30:090B / ?B / ?B
3nfouille740.05492012/05/03 19:39:390B / ?B / ?B

Python _

RankUserSizeTimeDateStatistics
1leonid990.14662012/05/10 03:44:140B / 47B / 46B
2twobit990.13412012/05/15 06:06:170B / 48B / 45B
3hallvabo1040.09772012/05/08 01:30:190B / 51B / 46B
4Hendrik1080.08672012/05/16 05:00:240B / 49B / 49B
5nooodl1210.09672012/05/02 23:41:035B / ?B / ?B

PHP _

RankUserSizeTimeDateStatistics
1clock870.12682012/05/03 18:19:107B / 33B / 47B

Scheme _

RankUserSizeTimeDateStatistics
1kaki920.22052012/05/04 04:01:530B / 50B / 35B
2kaki890.11112013/03/25 05:38:560B / 45B / 40B

Common LISP _

RankUserSizeTimeDateStatistics
1kaki1080.10392012/05/16 08:52:270B / 54B / 50B

Clojure _

RankUserSizeTimeDateStatistics
1kaki1013.45172012/05/16 11:53:303B / 32B / 64B

JavaScript _

RankUserSizeTimeDateStatistics
1nn1060.07692012/05/04 22:59:500B / 51B / 52B
2clock1080.17572012/05/05 02:45:440B / 51B / 54B
30mg1100.07392012/05/16 19:36:420B / 59B / 48B

Icon _

RankUserSizeTimeDateStatistics
1clock950.04052012/05/03 13:40:150B / 49B / 41B

REXX _

RankUserSizeTimeDateStatistics
1pooq1030.12972012/05/16 21:49:010B / 61B / 24B

J _

RankUserSizeTimeDateStatistics
1I., S.750.13172012/05/03 07:56:260B / 22B / 50B

C _

RankUserSizeTimeDateStatistics
1ush740.07022012/05/06 16:21:450B / 37B / 37B
2nn830.04632012/05/04 22:29:510B / 39B / 44B
3inaniwa840.03912012/05/05 10:19:020B / 40B / 44B
4chocobi890.04252012/05/04 03:25:180B / 51B / 38B
50mg900.06572012/05/04 22:50:370B / 48B / 42B
6biggles910.04162012/05/05 10:01:040B / 47B / 44B

D _

RankUserSizeTimeDateStatistics
1macik1590.04832012/05/14 00:30:480B / ?B / ?B
2alex1660.04522012/05/12 11:21:470B / 95B / 66B

Haskell _

RankUserSizeTimeDateStatistics
1henkma780.13082012/05/14 20:02:290B / 32B / 44B
2rst76800.09212012/05/14 01:52:270B / 33B / 45B
3cojna880.05882012/05/16 01:24:220B / ?B / ?B
4onyxite1210.03522012/05/08 05:57:100B / 49B / 67B

Asymptote _

RankUserSizeTimeDateStatistics
1chocobi1710.44662012/05/03 04:03:310B / 75B / 94B

AWK _

RankUserSizeTimeDateStatistics
1lvogel1040.03612012/05/15 03:43:540B / 46B / 57B

sed _

RankUserSizeTimeDateStatistics
1lvogel770.05862012/05/15 03:41:310B / 13B / 57B
2clock770.06552012/05/15 08:40:340B / 12B / 58B

Whitespace _

RankUserSizeTimeDateStatistics
1lvogel2110.05002012/05/16 04:42:480B / 0B / 0B

Befunge _

RankUserSizeTimeDateStatistics
1kaki480.04082012/05/16 07:55:120B / 3B / 45B
2lvogel560.10822012/05/15 18:24:580B / 13B / 43B

GolfScript _

RankUserSizeTimeDateStatistics
1clock400.13762012/05/16 22:26:330B / 5B / 35B
2twobit410.37752012/05/15 21:36:530B / 8B / 32B
3lvogel500.14082012/05/16 20:59:270B / 7B / 43B

Vim _

RankUserSizeTimeDateStatistics
1clock450.09612012/05/11 08:35:433B / 13B / 26B

goruby _

RankUserSizeTimeDateStatistics
1leonid490.19442012/05/16 03:48:420B / 12B / 35B
2kaki510.16162012/05/14 11:19:010B / 17B / 32B
3clock510.20142012/05/15 00:58:400B / 12B / 37B

Groovy _

RankUserSizeTimeDateStatistics
1nn736.68252012/05/15 22:30:150B / 31B / 38B
2clock813.78952012/05/15 01:28:580B / 37B / 40B

Language Ranking_

RankLangUserSizeScore
1GolfScriptclock4010000
2Perltybalt89429523
3Vimclock458888
4Befungekaki488333
5gorubyleonid498163
6Rubyyvl557272
7Groovynn735479
8Cush745405
9JI., S.755333
10sedlvogel775194
11Haskellhenkma785128
12PHPclock874597
13Schemekaki894494
14Iconclock954210
15Pythonleonid994040
16Clojurekaki1013960
17REXXpooq1033883
18AWKlvogel1043846
19JavaScriptnn1063773
20Common LISPkaki1083703
21Dmacik1592515
22Asymptotechocobi1712339
23Whitespacelvogel2111895

return top