Please, try EDU on Codeforces! New educational section with videos, subtitles, texts, and problems. ×

lsr10122018's blog

By lsr10122018, history, 9 months ago, In English,

Count of palindromes of length N having atmost k distinct characters such that no prefix (of size 2 to n-1) is palindrome.

for example If N = 3 and K = 3, possible palindromes are "aba", "aca", "bab", "bcb", "cac" and "cbc". so count is 6.

Here is a link of problem and solution

Can anyone help me with this problem?.

Not able to understand the solution mentioned on hackerearth as there is no editorial there. Having difficult time understanding how states are defined in solution.

  • Vote: I like it
  • +4
  • Vote: I do not like it

9 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by lsr10122018 (previous revision, new revision, compare).