ערכתי לאחרונה בתאריך 01.05.12 בשעה 20:38 בברכה, dvir8
או איך שקוראים לזה, הנה השאלה: קצת נתקעתי כאן, אולי האלגוריתם שלי לא הכי נכון. אגב אני מחפש פתרון ללא העמסה!!!
Given a string that contains a single pair of parenthesis, compute recursively a new string made of only of the parenthesis and their contents, so "xyz(abc)123" yields "(abc)". parenBit("xyz(abc)123") → "(abc)" parenBit("x(hello)") → "(hello)" parenBit("(xy)1") → "(xy)"
|
קומפיילר אונליין לכתיבה ובדיקה:
http://codingbat.com/prob/p137918