Brick Wall
Medium
Hashing (Advanced)
A wall is built from rows of bricks of equal height but different widths; every row has the same total width. A vertical line drawn from top to bottom crosses a brick unless it passes along a gap between bricks (the wall's two edges do not count). Print the minimum number of bricks the line must cross.
Constraints
1 <= r <= 10^4 Total number of bricks <= 2 * 10^4
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.