RGBRED — SPOJ

Revision en1, by hello_hell, 2021-08-30 19:43:15

Problem link: Color Play

I tried a greedy approach for this problem, here is my solution :

Spoiler

But this gave me WA. So I found a test case also:

Spoiler

answer should be 1 , but my code gives 3. I guess this is DP problem. Can anyone please help.

Tags #spoj, #help, #string, # dp

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English hello_hell 2021-08-30 19:43:15 1540 Initial revision (published)