This question evaluates proficiency with string algorithms and algorithmic problem-solving, focusing on palindrome detection and counting contiguous substrings. It is commonly asked to assess implementation skills and the ability to reason about time and space complexity within the Coding & Algorithms domain, emphasizing practical application rather than purely conceptual understanding.
Given a string s, count how many substrings of s are palindromes.
Return the total count.
Constraints (typical): 1 ≤ |s| ≤ 2000 (so an O(n^2) approach is acceptable).