Algorithm · Microsoft · Medium
You are given an integer array arr that represents the locations of n holes on a tabletop. Every position is distinct. You need to cover every hole using exactly two boards. Both boards must have the same positive integer length L. When a board of length L is placed with its left edge at coordinate X, it shields any hole whose position falls within the closed interval [X, X + L]. Find and return the smallest integer L for which two such boards can cover all the holes.…