Company: Microsoft_1sep
Difficulty: medium
Count Palindromic Subsequences of Length 5 Problem Description For a string s consisting only of characters '0' and '1', determine the number of subsequences of length 5 that are palindromes. Since the result can be very large, return the answer modulo (10 9 + 7). Notes: A palindrome is a sequence that reads the same backward and forward. A subsequence is obtained 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 used to form them are different. Complete the function getPalindromesCount in the editor with the following parameter: string s : the binary string Returns: int : the number of subsequences of length 5 which are palindromes, modulo (10 9 + 7) int getPalindromesCount(string s) { // Function implementation } Examples Example 1: Input: s = "0100110" Output: 5 Explanation: Using 1-based indexing, the 5 palindromic subsequences of length 5 are: indices (1, 2, 3, 6,