Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 0 # sum
- ?
- [
- # ASSUME: numbers on a card are unique in win and have sections
- # This means checking either way works correctly.
- 0 Sh # clear have table with push
- [
- 1r:h # have(top) = 1
- d 0<L # loop while next > 0 (0 is divider)
- ] dsLx
- # use divider (0) for count of wins
- [
- r;h+ # wins++ if have(top)
- z3<L
- ] dsLx
- # stack: sum cardNum wins
- rs. # junk cardNum
- 1-2r^ + # sum += (2^(wins-1)); note: 2^(-1) floored to 0 for 0 wins
- ? z1<M
- ] dsMx
- [Part 1: ]np
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement