0 votes 0 votes Consider the string “GATE2000”, the number of non-trivial substrings of given string are i am constatly confused in these types of substrings questions please specify some resource or plzz derive how to solve these questions Deepanshu asked Jan 5, 2019 Deepanshu 781 views answer comment Share Follow See all 9 Comments See all 9 9 Comments reply Shobhit Joshi commented Jan 5, 2019 reply Follow Share non-trivial means the substring's excluding $\varepsilon$ and the string itself. 0 votes 0 votes Deepanshu commented Jan 5, 2019 reply Follow Share hmm whats answer of above 0 votes 0 votes Shobhit Joshi commented Jan 5, 2019 reply Follow Share 35 ? 0 votes 0 votes Deepanshu commented Jan 5, 2019 reply Follow Share it is 32 but close enough whats approach 0 votes 0 votes Vegeta commented Jan 5, 2019 reply Follow Share Total 37 substring, 35 are non-trvial and total 2 ^8 subsequence. 0 votes 0 votes Shobhit Joshi commented Jan 5, 2019 reply Follow Share count the number of substrings it would be 8*9/2 = 36 000 -- three 1 length substrings 0,0,0 which are same, two 2 length substrings 00, 00 are same 1 for the original string 36 - (1+2+1) = 32 5 votes 5 votes Shubhgupta commented Jan 5, 2019 reply Follow Share answer should be 32 only there are 3 0's so substring '0','0','00' should be excluded from 35. @Deepanshu, there are 8 char. in string so total substring should be - n(n+1)/2 + 1= 8.9/2 +1 =37 2 are trivial and there are 3 0's so number of total non trivial substring = 37-2-3=32. 1 votes 1 votes Shaik Masthan commented Jan 5, 2019 reply Follow Share @Deepanshu specify the link in your question. i edited my answer with your requirement, may you check https://gateoverflow.in/216914/ 1 votes 1 votes Deepanshu commented Jan 5, 2019 reply Follow Share thanku everyone : ) 0 votes 0 votes Please log in or register to add a comment.