Ad
  • Custom User Avatar

    This has been happening to me for the past week. I don't know what the problem/solution is.

  • Custom User Avatar

    This is cool! Nice work

  • Custom User Avatar

    A little bit simple...

  • Custom User Avatar

    Thank you for the information. I checked out your profile and am pretty impressed. I want to get into programming competitions but I have a lot of practice ahead of me and I'm a full time student with a full time job. Do you have any tips on getting started?

  • Custom User Avatar

    I like this solution a lot. I have one question though: doesn't the str.replace() method create a whole new String in memory? If that's the case, this solution uses up to 3x more memory than necessary. Also, I imagine that str.replace() iterates through each character in the String anyway, resulting in O(2N) instead of O(N) that would have resulted in iterating through the string once and counting. Do they take inefficiencies like this into consideraton in programming competitions?