Question
Given a digit ‘3141592653’, find number of occurence of subsequence “123”. Note that the sequence occurs twice:
3141592653
1 2 3
1 2 3
Output 2.
Solution
Refer to [LeetCode 115] Distinct Subsequences.
Given a digit ‘3141592653’, find number of occurence of subsequence “123”. Note that the sequence occurs twice:
3141592653
1 2 3
1 2 3
Output 2.
Refer to [LeetCode 115] Distinct Subsequences.
Author:
Permalink: https://mar2ndx.github.io/2015/01/11/pre-2017-2015-01-11-numer-of-occurrence-given-subsequence/
License: Copyright (c) 2019 CC-BY-NC-4.0 LICENSE
Slogan: Do you believe in DESTINY?