Company: AT&T
Difficulty: medium
Validating Strings with RegEx Write a regular expression that validates strings starting and ending with the same character. A string is considered beautiful if it starts and ends with the same character. Given a list of strings made up of the characters 'a' and 'b', create a regular expression that will match strings that begin and end with the same letter. Example Strings "a", "aa", and "bababbb" match. Strings "ab" and "baba" do not match. Replace the blank ("_______") with a regular expression that matches strings as described. Locked code in the editor prints True for each correct match and False for each incorrect match. Constraints 1 ≤ query ≤ 10 3 1 ≤ length of each string[i] ≤ 10 3 Each character string[i] is either 'a' or 'b' Input Format for Custom Testing The first line contains an integer query, the number of strings to be tested. Each of the next query lines contains a string to validate. Sample Case 0 Sample Input STDIN Function ----- -------- 5 -> number of strings to b