Problem of the Day: Smiley Face

Smiley Face

Goal is to verify whether there are matching parenthesisisisisis while crawling through text that can contain a smiley emoticon “:)” that doesn’t count.

Quick idea is to use Java’s built-in split() function to pull out the emoticon, put the string back together, and count the parenthesisisisisis with a simple +/- counter. If the end result is 0 then the parenthesisisisisisisisisisisisisis match!.

Otherwise it’d be parsing the string and not counting any “)” that has a “:” before it. More work than I want to do though.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: