`{"id":"6f05bd5f-91ea-4ba3-beb9-8eb41b05102b","name":"Count A+b+c+ Subsequences","description":"1. You are given a string str.\r\n2. You are required to calculate and print the count of subsequences of the nature a+b+c+.\r\nFor abbc -> there are 3 subsequences. abc, abc, abbc\r\nFor abcabc -> there are 7 subsequences. abc, abc, abbc, aabc, abcc, abc, abc.","inputFormat":"A string str","outputFormat":"count of subsequences of the nature a+b+c+","constraints":"0 &lt; str.length &lt;= 10","sampleCode":{"cpp":{"code":"#"},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n public static void main(String[] args) throws Exception {\r\n\r\n }\r\n}"},"python":{"code":"p"}},"points":10,"difficulty":"easy","sampleInput":"abcabc","sampleOutput":"7","questionVideo":"https://www.youtube.com/embed/IV9pbZsi5cc?end=76","hints":[],"associated":[{"id":"1feb5031-5755-43d2-b46f-3e52d3744426","name":"How many no of variables are required?","slug":"how-many-no-of-variables-are-required","type":4},{"id":"b3f18279-3309-44ee-851a-49c611d2191c","name":"Is DP array compulsory in this question?","slug":"is-dp-array-compulsory-in-this-question","type":4},{"id":"b9462ee8-bc4d-4910-9a3e-632b483c9dc9","name":"What will be the Time Complexity of our solution?","slug":"what-will-be-the-time-complexity-of-our-solution","type":4},{"id":"e4f1344e-18bf-4cab-aa5b-6cf204c4bd9d","name":"What will be the Space Complexity of our solution?","slug":"what-will-be-the-space-complexity-of-our-solution","type":4}],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"52d62581-1313-45fb-aaf0-1d72a45f6a50","name":"Dynamic Programming And Greedy For Beginners","slug":"dynamic-programming-and-greedy-for-beginners","type":0},{"id":"28d9df5f-f705-4fde-8a1c-a50ccb3ef412","name":"Count A+b+c+ Subsequences","slug":"count-a-b-c-subsequences","type":1}],"next":{"id":"a4b36671-7282-4ef5-bd31-5e90926eeb84","name":"Count A+B+C+ Subsequences","type":3,"slug":"count-a-b-c-subsequences"},"prev":{"id":"8b497db1-7cd2-4f42-95ef-335dd6133381","name":"Count Encodings","type":3,"slug":"count-encodings"}}}`

# Count A+b+c+ Subsequences

1. You are given a string str. 2. You are required to calculate and print the count of subsequences of the nature a+b+c+. For abbc -> there are 3 subsequences. abc, abc, abbc For abcabc -> there are 7 subsequences. abc, abc, abbc, aabc, abcc, abc, abc.

`{"id":"6f05bd5f-91ea-4ba3-beb9-8eb41b05102b","name":"Count A+b+c+ Subsequences","description":"1. You are given a string str.\r\n2. You are required to calculate and print the count of subsequences of the nature a+b+c+.\r\nFor abbc -> there are 3 subsequences. abc, abc, abbc\r\nFor abcabc -> there are 7 subsequences. abc, abc, abbc, aabc, abcc, abc, abc.","inputFormat":"A string str","outputFormat":"count of subsequences of the nature a+b+c+","constraints":"0 &lt; str.length &lt;= 10","sampleCode":{"cpp":{"code":"#"},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n public static void main(String[] args) throws Exception {\r\n\r\n }\r\n}"},"python":{"code":"p"}},"points":10,"difficulty":"easy","sampleInput":"abcabc","sampleOutput":"7","questionVideo":"https://www.youtube.com/embed/IV9pbZsi5cc?end=76","hints":[],"associated":[{"id":"1feb5031-5755-43d2-b46f-3e52d3744426","name":"How many no of variables are required?","slug":"how-many-no-of-variables-are-required","type":4},{"id":"b3f18279-3309-44ee-851a-49c611d2191c","name":"Is DP array compulsory in this question?","slug":"is-dp-array-compulsory-in-this-question","type":4},{"id":"b9462ee8-bc4d-4910-9a3e-632b483c9dc9","name":"What will be the Time Complexity of our solution?","slug":"what-will-be-the-time-complexity-of-our-solution","type":4},{"id":"e4f1344e-18bf-4cab-aa5b-6cf204c4bd9d","name":"What will be the Space Complexity of our solution?","slug":"what-will-be-the-space-complexity-of-our-solution","type":4}],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"52d62581-1313-45fb-aaf0-1d72a45f6a50","name":"Dynamic Programming And Greedy For Beginners","slug":"dynamic-programming-and-greedy-for-beginners","type":0},{"id":"28d9df5f-f705-4fde-8a1c-a50ccb3ef412","name":"Count A+b+c+ Subsequences","slug":"count-a-b-c-subsequences","type":1}],"next":{"id":"a4b36671-7282-4ef5-bd31-5e90926eeb84","name":"Count A+B+C+ Subsequences","type":3,"slug":"count-a-b-c-subsequences"},"prev":{"id":"8b497db1-7cd2-4f42-95ef-335dd6133381","name":"Count Encodings","type":3,"slug":"count-encodings"}}}`

Editor

# Count A+b+c+ Subsequences

easy

1. You are given a string str. 2. You are required to calculate and print the count of subsequences of the nature a+b+c+. For abbc -> there are 3 subsequences. abc, abc, abbc For abcabc -> there are 7 subsequences. abc, abc, abbc, aabc, abcc, abc, abc.

## Constraints

0 < str.length <= 10

## Format

A string str

### Output

count of subsequences of the nature a+b+c+

## Example

Sample Input

`.css-23h8hz{color:inherit;font-size:0.875rem;line-height:1.125rem;letter-spacing:0.016rem;font-weight:var(--chakra-fontWeights-normal);white-space:pre-wrap;}abcabc`

### Sample Output

`.css-3oaykw{color:var(--chakra-colors-active-primary);font-size:0.875rem;line-height:1.125rem;letter-spacing:0.016rem;font-weight:var(--chakra-fontWeights-normal);white-space:pre-wrap;font-family:Monospace;}7`

Question Video

Discussions

Show Discussion

Related Resources