Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from rx import Observable
- numbers = Observable.from_([1,1,1,0,0,2,2,3]) \
- .scan(lambda x,i: max(x,i)) \
- .distinct() \
- .to_list() \
- .map(lambda x: len(x)) \
- .subscribe(lambda s: print(s-1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement