This is a verified interview question from Akamai. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Regular Expression Matching" covers key patterns like Strings.
"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. ### Problem 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. ### Input - 1 ≤ query ≤ 10^3 - 1 ≤ length of each string(s) ≤ 10^3 - Each character s(i) is either 'a' or 'b' ### Output ### Example Strings "a", "aa", and "bababbb" match. Strings "ab" and "baba" do not match."
Join thousands of developers practicing for Akamai.