Write a function to deflate an array into a multi-layered JSON object.
Each array element is an object with a non-empty path array of string keys and a value. Build and return one nested Python dictionary by creating objects for each path segment. If paths overlap, a later record replaces an earlier value at the same location. If a path requires descending through a scalar, replace that scalar with an object.
Signature: def deflate(records):
Input: A list of { "path": [...], "value": ... } records. Output: A nested dictionary containing the supplied values.
def deflate(records):