This is a verified interview question from Adobe. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Beautiful String (Regex) - Adobe Online Assessment IIT Roorkee" covers key patterns like Arrays.
"### Problem 0: Implement Naive Bayes in python ### Problem 1: DSA A string is called beautiful if its first and last characters are the same. Given a string S, determine whether it is beautiful. Input Format A single line containing the string S. Output Format Print: "Yes" if the string is beautiful. "No" otherwise. Examples Input: abca Output: Yes Input: hello Output: No Input: z Output: Yes Explanation "abca" → first = 'a', last = 'a' → Beautiful "hello" → first = 'h', last = 'o' → Not Beautiful "z" → first = last = 'z' → Beautiful ### Note: In Online Assessment Instead of writing normal string comparison logic, implement the solution using a regular expression. The program should print: true if the string matches the required pattern. false otherwise. Hint: Use a capturing group for the first character and ensure the last character matches the captured character. Example regex pattern: ^(.).*\1$ Note: Since the pattern above does not match single-character strings, you may modify it appropriately (or handle that case separately) depending on the regex engine used."
Join thousands of developers practicing for Adobe.