Ad
  • Custom User Avatar

    But then you have 2 times more vowels to check, so, all in all... That's just about mircooptimization, that doesn't change the time complexity. You generally don't care about microoptimizations as long as you don't do useless stuff.

  • Custom User Avatar

    I wonder if CPU and time overhead of pattern is worth few kilobytes of memory.
    String#split does not compile Pattern at all, if it detects regex contains only non-regex characters and fus should be slightly softer on CPU (but performace test are needed).
    I think Pattern#splitAsStream could be used as readability argument, but in terms of overhead, I would not consider as performance optimization.

  • Default User Avatar

    Could give a better precision in some cases but since the results are in a string with "%.0f" I think it is not in the spirit of the kata. I am sorry to see that you used them:-(