Given two strings s and t, find the shortest substring of s that contains all characters of t with multiplicity (i.e., if t has two 'a's, the window must contain at least two 'a's).
s
,
t
1 <= |s| <= 2e5
,
1 <= |t| <= 2e5
, ASCII letters
Given two integer arrays A and B (not necessarily the same length) and an integer k, return the k pairs (A[i], B[j]) with the smallest products A[i] * B[j].
k
pairs exist, return all pairs.
Assumptions to state in interview (choose as needed):
Design an in-memory LRU (Least Recently Used) cache that supports:
get(key) -> value | -1
put(key, value)
Requirements:
C
: when adding beyond capacity, evict the least-recently-used entry.
Follow-up: Make the cache safe for multi-threaded access (explain locking strategy and potential contention).