Company: Airtel
Difficulty: medium
Steven\'s Substring (Sunset on 12 April) Steven is trying to perform a string operation. He must find the same consecutive characters in groups of even and odd lengths in the string, merge them, and check if they are a palindrome. For e.g. if a string is (aabb) we can convert it to ab. Your task is to help Steven find and return the number of even and odd substrings from the original string which becomes palindromic after merging. Notes: Strings which are the same while reading backward and forward are called palindromes. The input string is made up of characters \'a\' and \'b\' only. Only groups could be formed from left to right. Input Format A string containing only characters \'a\' and \'b\' Output Format Return an array of two integers where: First integer represents count of even length palindromic substrings Second integer represents count of odd length palindromic substrings Examples Example 1: Input: baa Output: [1,3] Explanation: Here we have been given a string (b,a,a) we ca