5 kyu

Numbers with The Highest Amount of Divisors

306 of 599raulbc777
Description
Loading description...
Fundamentals
Algorithms
Data Structures
Mathematics
Arrays
  • Please sign in or sign up to leave a comment.
  • Yushi.py Avatar

    In the description, under "Examples", the brackets in proc_arrInt(arr1) ------> [21, 2, [9, [36]] are mismatched (3 opening, 2 closing).

  • saudiGuy Avatar

    Python: Random tests are vulnerable to input modification

  • saudiGuy Avatar

    python new test framework is required. updated in this fork

  • ahmet_popaj Avatar

    Challenging finding out the optimal solution though pretty intuitive.

  • vpopolitov Avatar

    again example 1:

    2 primes: 73 and 97

    97 isn't a member of the source array, primary 59 is

  • rowcased Avatar

    example 1 - missing a closing bracket

    proc_arrInt(arr1) ------> [21, 2, [9, [36]]

  • dfhwze Avatar
  • Simple Rick Avatar

    It seems like random tests sometimes pass the user arrays with duplicate numbers, and sometimes don't, but example test cases never do.

    This solution passed all random tests the first time. Then when I ran it again, it failed 3 or 4 times in a row before passing again without any changes.

    The cases it fails are always random and include a duplicate number in the array of most divisible numbers. ie. "expected [ 417, 31, [ 60, [ 20592, 23184 ] ] ] to deeply equal [ 417, 31, [ 60, [ 20592, 20592, 23184 ] ] ] "

  • akar-0 Avatar
  • akar-0 Avatar
  • ejini战神 Avatar
    • Description should be language-agnostic

    • Maximum array length and maximum array value should be specified clearly

  • ejini战神 Avatar

    JS

    • Node 14. should be enabled

    • Unnecessary logs should be removed

  • ejini战神 Avatar

    Ruby

    • 3.0 should be enabled

    • Unnecessary logs should be removed

    • Function and parameter name should be snake_case

  • ejini战神 Avatar

    Python

    • New test framework should be used

    • The input array's length should have an upper boundary of 500 (Same as other 2 languages)

    • Function and parameter name should be snake_case

  • FArekkusu Avatar

    Empty it blocks must be removed from tests.

  • anter69 Avatar

    Python: the test cases include a primes function, which can (and will) conflict with the users' function/variable names.

  • lechevalier Avatar

    Can you make this kata Python 3 compliant?

  • Voile Avatar

    Approved

  • JohanWiltink Avatar

    Feels a little contrived.

    Return value is composed of conceptually entirely different values.

    Suppose you ask for two arrays, one with the numbers from the input list with the least number of divisors and one with the numbers with the most.

    What rolls out is a list of primes (well, probably) and a list of highly divisible numbers.

    People will probably recognise the primes, and might recognize 12, 60 and 360 as something to do with number bases or dividing circles into angles.

    And the return values would be more elegantly different but similar.

  • Zerazera Avatar

    Slight mistake in test cases for Python. lines 3 and 5 use test.describe() instead of test.assert_equals().