← PayPal questions

Count valid strings with matching first and last characters and no adjacent repeats

Filed under PayPal

Given a string with lowercase letters and '?', where '?' can be any letter, count the number of ways to replace '?' such that the first and last characters are equal and no two adjacent characters are…

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related PayPal questions

Collected from public candidate posts and coding forums. Updated Nov 2026.