Skip to content

Instantly share code, notes, and snippets.

@nikasulo
Created August 29, 2019 12:27
Show Gist options
  • Save nikasulo/1fad29ba621f6ffa24088f727738cad7 to your computer and use it in GitHub Desktop.
Save nikasulo/1fad29ba621f6ffa24088f727738cad7 to your computer and use it in GitHub Desktop.
If stack is empty push first character
if s.is_empty?
s.pushFront(string[i]) if string[i] == '{' || string[i] == '[' || string[i] == '('
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment