This algorithm has a bug in it.
(Spoiler Alert: Solution below)
This is the same pseudocode with the bug removed
Did I miss any bugs?
For further actions, you may consider blocking this person and/or reporting abuse
Ajisafe Oluwapelumi -
Vedant Chainani -
Jessica Alves -
Merdan Durdyyev -
Once suspended, iamalexbrady will not be able to comment or publish posts until their suspension is removed.
Once unsuspended, iamalexbrady will be able to comment and publish posts again.
Once unpublished, all posts by iamalexbrady will become hidden and only accessible to themselves.
If iamalexbrady is not suspended, they can still re-publish their posts from their dashboard.
Once unpublished, this post will become invisible to the public and only accessible to alex brady.
They can still re-publish the post if they are not suspended.
Thanks for keeping DEV Community safe. Here is what you can do to flag iamalexbrady:
Unflagging iamalexbrady will restore default visibility to their posts.
Top comments (2)
Did you miss any bugs? Yes, the question count is undefined. For it to work in your code it needs to start at zero, otherwise the length of the game is indeterminate and possibly infinite :)
I actually just fixed this in the actual blog post yesterday. Good eye!