Explain how you would solve a minimum interval algorithm problem and what edge cases you would check.
Implement min_interval(intervals, queries). For each query value, return the length of the smallest inclusive interval [left, right] such that left <= query <= right, or -1 if no interval contains it. Return answers in the same order as queries.
Input values are integers, and intervals may overlap or contain one another.
def min_interval(intervals, queries):