Microsoft OA | SWE Internship | BIT MESRA | July 25, 2023 | Symmetric Strings|Balance the boards
Microsoft · Question · Posted Jul 2023
Question 1 Symmetric strings A string made of an even number of characters ("<" and/or ">") is called symmetric if characters in its first half are "<" and all characters in its second half are ">". Examples of symmetric strings are: ""(empty string), "< >"; "<< >>"; "<<< >>>", etc. Write a function: int solution (string &S); that, given a string S made of N characters ("<",">" and/or "?"), returns the length of the longest symmetric substring that can be obtained ...
The full answer & interview discussion are available to premium members.
Log in Create a free account