Running histogram stream with Rx
问题 I have the following single letter stream A B C A D B A C D And from this stream, I would like a stream of running count per letter (A,1) (A,1), (B,1) (A,1), (B,1), (C,1) (A,2), (B,1), (C,1) (A,2), (B,1), (C,1), (D,1) (A,2), (B,2), (C,1), (D,1) (A,3), (B,2), (C,1), (D,1) (A,3), (B,2), (C,2), (D,1) (A,3), (B,2), (C,2), (D,2) , i.e at each new letter, the totals are updated and emitted. I guess this problem is fairly language agnostic, so don't hesitate to propose a solution in your language of