Skip to content
← Back to the archive

3 September 2026

Paint Plan

Medium Lists Numbers

Find how many paint tins are needed to cover all the rooms.

You are given the wall area of each room and the area that one paint tin can cover. First, add together the areas of all the rooms. Return the number of whole paint tins needed to cover that total. If there is any area left after filling complete tins, you still need one more tin. Return 0 when there are no rooms.

Constraints

  • room_areas contains at most 100 positive whole numbers
  • coverage_per_tin is a positive whole number
  • One tin covers the same area in every room

Function signature

def paint_tins(room_areas, coverage_per_tin):

Sign in to solve this bracket

Reading the problem is free for everyone. Opening the editor and solving it requires an account with Open Bracket+.