The East Campus Nth Annual Python Bee

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
11,987
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jan 22, 2011

This is from the final round where our last two contestants competed for a Kindle.

Contestants were not allowed to see their code or have it read back to them in any way. They had to specifically dictate all spelling and punctuation (and tabbing).

The challenge for the last round was to write a function that would return true if and only if the string passed to it had matching sets of parentheses.

Category:

Science & Technology

Tags:

License:

Standard YouTube License

  • likes, 4 dislikes

Link to this comment:

Share to:

Uploader Comments (MichaelCiuffo)

  • you really don't need the if <0 statement

  • @foggydoggydoo You actually do. Otherwise, ")(" would return True.

Top Comments

  • HI EVERYBODY!!!!

see all

All Comments (47)

Sign In or Sign Up now to post a comment!
  • why are there so many dumb comments saying his code was wrong. it was damn right. and he did it without a screen. damn.

  • @Orbofs: Try doing that without seeing your screen or writing anything down - if you forget your last character, you're done.

    If MIT Comp. Sci. students can't do it, it's hard.

  • my answer

  • I solved this in 15 seconds in my head. Is he serious?

  • Cool :D

  • @emptist I'm not familiar with Python but I believe the "if lvl<0: return false" catches that condition. The moment the counter "lvl" goes negative it will return false.

  • The singular of parentheses is parenthesis.

  • @emptist Actually, it would return False on the third run of the for.

  • sorry but "())(" will return true and that is wrong

  • test if I can comment

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more