Count Special Subsequences
A sequence is considered special if it starts with a positive number of 0s, followed by a positive number of 1s, and then a positive number of 2s. For example, sequences like [0,1,2] and [0,0,1,1,1,2] are special, whereas sequences like [2,1,0], [1], and [0,1,2,0] are not. Given an array nums containing only integers 0, 1, and 2, the task is to determine and print the number of different subsequences that are special. Since the result might be large, return it modulo 10^9 + 7.
Ada AI
I want to discuss a solution
Help me solve this
Give more examples
What's wrong with my code?
How to use 'for loop' in javascript?
javascript (node 13.12.0)