Get best answers to any doubt/query/question related to programming , jobs, gate, internships and tech-companies. Feel free to ask a question and you will receive the best advice/suggestion related to anything you ask about software-engineering , development and programming problems .

0 like 0 dislike
2,450 views
in Online Assessments by Expert (32,020 points)

1 Answer

0 like 0 dislike

QUESTION -
Given a string S of length N, Return the count of all the possible Unique Sub-Sequences of Length N-2, which can be derive from given string (each Sub-Sequences should have length = N-2).
String contains only number from 0 to 9.
As the result can be large return ans module (10^9) + 7.

 

sample test 1 -
input string : "15025"
output : 10
Explaination : All Unique Sub-Sequencesof length (5-2) 3 are - "025","525","505","502","125","105","155","125","150","102"

 

sample test case 2 :
input string : "781484"
output : 14

 

Constrains -
0 <= s[i] <= 9
2 <= N <= 100000

by Expert (32,020 points)
...