Make a copy of Z immutable, then attempt to write to it. Return True if the write raised an error, else False.
Z
True
False
solve(...)