Beta

Office Mission #2: Estimate the workload

Description
Loading description...
Puzzles
  • Please sign in or sign up to leave a comment.
  • dfhwze Avatar

    I haven't verified, but my solution sometimes finds a more optimal structure:

    Testing for:
    workingHours = 8
    tasks = [7,8,7,1,5,7,8,2,8,1,8,5,5,2,7,5,6,2,5,5,6,2,3,3,2,5,4,5,3,1,1,8,5,2,2,1,4,6,7,2] 
    [
      [ 8 ],    [ 8 ],    [ 8 ],
      [ 8 ],    [ 8 ],    [ 7, 1 ],
      [ 7, 1 ], [ 7, 1 ], [ 7, 1 ],
      [ 7, 1 ], [ 6, 2 ], [ 6, 2 ],
      [ 6, 2 ], [ 5, 3 ], [ 5, 3 ],
      [ 5, 3 ], [ 5, 2 ], [ 5, 2 ],
      [ 5, 2 ], [ 5, 2 ], [ 5, 2 ],
      [ 5 ],    [ 4, 4 ]
    ]
    expected 23 to equal 24
    
  • dfhwze Avatar

    Random tests are weak. A simple algorithm passes most of the time.

  • ZED.CWT Avatar
    Testing for:
    workingHours = 15
    tasks = [3,8,12,11,5,1,4,14,12,4,10,6,13,7,15,15,3,4] 
    Expected: 11, instead got: 10
    
    Solution for 10
    15
    15
    14,1
    12,3
    12,3
    11,4
    10,5
    8,7
    6,4,4
    13
    
    Testing for:
    workingHours = 3
    tasks = [1,2,1,1,2,1,1,1,3,3,3,3,3,3,2,3,2,3,2,2,1,2] 
    Expected: 17, instead got: 15
    
    Solution for 15
    3
    3
    3
    3
    3
    3
    3
    3
    2,1
    2,1
    2,1
    2,1
    2,1
    2,1
    2,1
    
    
    Testing for:
    workingHours = 12
    tasks = [2,6,1,6,5,11,2,2,11,3,3,10,2,6,9,6,9,3,2,6,11,12,9,6,9,5,9,5,3,11,3,10,7,11,7,12,6,9,12,9,10,8,10] 
    Expected: 29, instead got: 26
    
    Solution for 26
    12
    12
    12
    11,1
    10,2
    10,2
    10,2
    10,2
    9,3
    9,3
    9,3
    9,3
    9,3
    7,5
    7,5
    6,6
    6,6
    6,6
    11
    11
    11
    11
    9,2
    6,5
    9
    8