Skip to content

Instantly share code, notes, and snippets.

@nikasulo
Created September 4, 2019 22:53
Show Gist options
  • Save nikasulo/8c55780872f281d2768fd4ac1f1a2bd1 to your computer and use it in GitHub Desktop.
Save nikasulo/8c55780872f281d2768fd4ac1f1a2bd1 to your computer and use it in GitHub Desktop.
Check for g, n and others
if string[i] == 'g'
deque.pushBack(string[ i ])
next
elsif string[i] == 'n'
deque.pushFront(string[ i ])
next
else
deque.empty_into(result) unless deque.empty?
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment