Skip to content

Instantly share code, notes, and snippets.

@RobertDober
Created July 31, 2017 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RobertDober/2270089a56aba90ef26ffb98905feb24 to your computer and use it in GitHub Desktop.
Save RobertDober/2270089a56aba90ef26ffb98905feb24 to your computer and use it in GitHub Desktop.
function! s:parse_up_to_prime(pushers, poppers, acc, ele)
let [l:result, l:count] = a:acc
" run through case
if l:count < 0
return a:acc
endif
call lab42#test#dbg_many(a:ele, a:poppers)
let l:increment = ( index(a:pushers, a:ele) >= 0 ? 1 : 0)
let l:increment = ( index(a:poppers, a:ele) >= 0 ? -1 : l:increment)
return [l:result . a:ele, l:count + l:increment]
endfunction
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment