yaminote's blog

By yaminote, history, 2 years ago, In English

I have using Chelper plugin for CP for quite a while. I am encountering problems with it now. When I declare an array as a global variable in my code then in Main.java int ar[] appears as int ar. How to fix this issue.

Full text and comments »

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

By yaminote, history, 2 years ago, In English

I am getting WA on three of the test cases on following solution- https://www.codechef.com/viewsolution/54539476 My logic

If K is 0 and all indices are same then print N else -1; Now moving to when K>0 I check for each letter using a loop seeing what would be the answer if the given letter were remaining, I find the number of consecutive set of gaps in between the given letters. Now If gaps are less than or equal to K then the answer is the number of letters itself. Otherwise we are supposed to remove any of the (gaps-(k-1)) consecutive gaps and see how many of the given letter are removed in the process. Anything wrong with the approach?

Full text and comments »

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