Implement a smart pointer.
Asked in the phone screen stage. Preceded by memory questions.
Implement the behavior through def smart_pointer(operations):. Each operation is an array:
["make", name, value] creates an object and its first owner.["copy", new_name, existing_name] creates another owner of the same object.["refs", name] records the current reference count.["value", name] records the stored value.["release", name] releases that owner.Return outputs for refs and value operations in order. Inputs are valid, and an object is reclaimed when its count reaches zero.
def smart_pointer(operations):