You are given a dictionary catalog keyed by product id (string). Each value is a record {'sales': list[int], 'target': int}, where sales is a list of daily sales counts (chronological) and target is an integer threshold.
Return the set of product ids for which the sum of the last three entries of sales is strictly greater than target. If a product has fewer than three recorded sales, use all of its sales in the sum. If no product qualifies, return an empty set.
NOTE: This is a function-type question — you only write the function. Do not read input or print anything; a hidden checker calls your function and checks its return value.
Arguments
{'p1': {'sales': [5, 5, 5, 5], 'target': 12}, 'p2': {'sales': [1, 1, 1], 'target': 5}}
Returns
{'p1'}