Stack vs. Heap, identifying the cause of a NullPointerException from a code snippet.
Implement find_null_pointer(lines). Each input line models a reference assignment, object allocation, field update, field read, or method call. Return the first null dereference as a zero-based line report, or null if execution completes without one. Variables hold references to heap objects, and missing object fields are treated as null.
def find_null_pointer(lines):