hello_hell's blog

By hello_hell, history, 3 years ago, In English

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.

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?