Sign In
You are coding as a Guest. Sign in with your RoleNest account to permanently track your streak, earn XP, and climb the Campus Leaderboard!
Sign In with RoleNest
🔥Palindromic Substrings: Center Expansion CounterMedium
DAILY PROBLEM OF THE DAY+50 XP • Daily Streak

Solve today's challenge or tackle one of the 3 Super Hard challenges for +150 XP.

MediumTwo Pointers•Acceptance: 68.9%

Palindromic Substrings: Center Expansion Counter

Targeted in FAANG & Tech OA:GoogleMicrosoftMeta
Real-World Engineering Context
Used in bioinformatic palindrome hairpin loop RNA folding analysis and data compression algorithms.
Given a string `s`, return the number of palindromic substrings in it. A string is a palindrome when it reads the same backward as forward. A substring is a contiguous sequence of characters within the string.

Sample Test Cases

Input: ["abc"]
Expected: 3
Input: ["aaa"]
Expected: 6
Input: ["a"]
Expected: 1

Constraints

  • 1 <= s.length <= 1000
  • s consists of lowercase English letters.
Recruiter Fast-Track ReferralVerified Candidate
Direct pipeline to Google, Amazon, Microsoft, Swiggy, & Uber recruiters
DevScore: 750/1000

Top DevScore profiles bypass resume screening filters. Every verified problem solve writes authentic proof-of-work to your profile and dispatches you directly into employer inboxes on RoleNest.