// Find the longest palindromic substring using expand-around-center approach. // For each position, try expanding outward while characters match. // Check both odd-length (single center) and ...
// Time Complexity: O(n²) (due to substring creation and window reset) } else if (right == s.length() - 1 && !(map.containsKey(s.substring(left, right + 1)))) { map ...