Ad
  • Custom User Avatar

    The tests are inconsistent with the requirements and among themselves:

    The priority is that the space is as small as possible, so first you must find the smallest spaces that fit, and if there is a tie, place them in the leftmost space.
    When placed, the barrels must be positioned from left to right in the available space.

    implies that array should be filled frol left to right or from index 0 to index -1(in python)

    Some tests follow through with it but some tests don't:
    testing for: warehouse = ['', '', '', '0', '', ''], barrels = ['0', '0']
    ['0', '0', '', '0', '', ''] should equal ['', '', '', '0', '0', '0']

    testing for: warehouse = ['', '', '0', '', '', '0', '0', '', '', '', '0', '', '', '', ''], barrels = ['0', '0', '0']
    Test Passed

    in the first test the issue is that warehouse is expected to be filled frol right to left or from index -1 to 0.
    The issue of the other test is that it is complitely fine if array is filled from left to right or from 0 to -1.

    Otherwise it's a nice task I had fun solving. Thank you for that.

  • Custom User Avatar
    test.assert_equals(calc_max([55,25,297,420]), 77)
    

    Consider this:

    • width of 55 goes 5 times into 297
    • height of 25 goes 16 times into 420

    5 * 16 = 80 images can fit into the area.

    Why is 77 the expected answer?