Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

FaceBook Hacker Cup Balanced Smiley Problem

$
0
0
Hi, I am working on 2nd solution.
I have made this code.
http://pastebin.com/PD0JPeDf

Problem Link : http://www.facebook.com/hackercup/problems.php?pid=403525256396727&round=185564241586420

I am bit confused about the problem and that is

They said
A message has balanced parentheses if it consists of one of the following:

- An empty string ""
- One or more of the following characters: 'a' to 'z', ' ' (a space) or ':' (a colon)
- An open parenthesis '(', followed by a message with balanced parentheses, followed by a close parenthesis ')'.
- A message with balanced parentheses followed by another message with balanced parentheses.
- A smiley face ":)" or a frowny face ":("


SO if any of those statement is true, It will be balanced.

But they said :(( is not balanced, but is satisfy the last term. So why it is not balanced?

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>