Ad
  • Custom User Avatar

    You can validate source code. isMathySolution(require('fs').readFileSync('/home/codewarrior/solution.txt', 'utf8')); :)

    I like to think of this as a 2 part problem. First you've got to come up with a way of finding the most significant digit of the numbers, then create a distribution array.

    This isn't affected by people using string manipulations, right?
    I asked why you'd want to encourage people to do it 'math-y' because I don't think it adds much difficulty or improve performance. Isn't it just some log10,pow,floor?

  • Custom User Avatar

    I'd recommend authoring a new kata "find the most significant digit without string manipulation" if it doesn't exist yet and require solving arithmetically.

    Can you tell me why you want to encourage people to find the most significant digit arithmetically when the goal is to "provide a function that returns the distribution of the most significant digits"?