Implement usePrevious(initialValue) — a hook simulation that:
get() function to read the previous value.update(newValue) function that shifts current → previous.On the first call, get() returns null.
solve(initial, updates) creates the hook, applies updates, and returns
the recorded history of [previous, current] pairs.
const [get, update] = usePrevious(0);
// get() → null
update(1); // get() → 0
update(2); // get() → 1Sample tests