2. Palindrome Subsequences For a string s which consists only of characters ' 0 ' and ' 1 ', find the number of subseque

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

2. Palindrome Subsequences For a string s which consists only of characters ' 0 ' and ' 1 ', find the number of subseque

Post by answerhappygod »

2 Palindrome Subsequences For A String S Which Consists Only Of Characters 0 And 1 Find The Number Of Subseque 1
2 Palindrome Subsequences For A String S Which Consists Only Of Characters 0 And 1 Find The Number Of Subseque 1 (47.12 KiB) Viewed 57 times
2 Palindrome Subsequences For A String S Which Consists Only Of Characters 0 And 1 Find The Number Of Subseque 2
2 Palindrome Subsequences For A String S Which Consists Only Of Characters 0 And 1 Find The Number Of Subseque 2 (47.12 KiB) Viewed 57 times
2. Palindrome Subsequences For a string s which consists only of characters ' 0 ' and ' 1 ', find the number of subsequences of length 5 which are palindromes. As the answer can be really big, return the answer mod (109+7) Note - A palindrome is a string that reads the same backward as forward. - A subsequence is a sequence that can be derived from the given sequence by deleting zero or more elements without changing the order of the remaining elements. - Two subsequences are considered different if the indices of the string that forms the subsequences are different. Example s=−0100110n Using 1-based indexing, the 5 subsequences are - indices (1,2,3,6,7)→01010 - indices (1,2,3,5,7)→01010 - indices (1,2,4,6,7)→01010 - indices (1,2,4,5,7)→01010 - indices (1,2,5,6,7)→01110 5 modulo (109+7)=5 10 Function Description Complete the function
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply