Advertisement
Guest User

Untitled

a guest
Oct 13th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. def jeffs_fav(w[1...n], q[1...k], delta, s_idx):
  2. w_states[1...n+2]
  3. w_states[1] = s_idx
  4. for i from 1 to n:
  5. w_states[i+1] = delta(w_states[i], w[i])
  6. w_states[n+2] = delta(w_states[n+2], null)
  7. for i from n+2 down to 2:
  8. if w_states[i] = s_idx and q[w_states[i - 1]] is False:
  9. return False
  10. return True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement