Save 25%Black Friday: 25% off all plans — use code BLACKFRIDAY2026 at checkout. Ends Friday, Dec 4.Claim the deal

You have nn holes on the surface of an old table, each hole's position given in an integer array arr. You want to cover all these holes using exactly two boards of the same positive integer length. If a board of length LL is placed at position XX, it will cover any hole whose position is in the range [X,X+L][X, X + L] inclusively.

Test Cases
Input
Output
Expected