Ad
  • Default User Avatar

    I am somewhat new to codewars, so maybe this feature is available and I'm just not aware of it. I like the ability to observe other peoples implementation; it's good for education in various clever approaches to problem solving, and idiocyncracies of a language. I noticed that the small and full test suite show run time. hmm... what about comparing various implementations using Benchmark to rank efficiency of a solution? So I did that using mine and 5 other solutions, then started refining mine with lessons learned from the benchmarking. Some things that work for a single method testing (altering default input array) become problems when testing multiple methods. Some techniques (smartmatching), while valid for the language, are just slower when compared to "less clever" techniques (simple for loop). Is there a good place in codewars to post my code and findings? Do other languages have something like the Perl Benchmark module for time testing, stress testing?

  • Default User Avatar

    fwiw, in Perl, the use of printf("%.0f",$float) does a "round half to even" which does not work like the conventional "round to infinity" that we learned in grade school math.

    the kata could be improved to catch this case, possibly. Not sure if this matters in other languages.

    Stack Overflow for the win.