Given a C code snippet in a shared Google Doc, explain what is wrong with it.
Asked in the Technical interview 1 stage. Casual first technical round.
Implement explain_c_issues(code), which returns recognized issue labels in this order when present: unsafe_input, unchecked_allocation, unsafe_copy, string_pointer_comparison, and missing_free. Return each label at most once. The input is a C source snippet as a string, and the output is a list of strings. Detect gets, unchecked malloc, strcpy, comparisons between declared character strings or character pointers, and allocated memory that is never freed.
code is a string containing at most 5,000 characters.def explain_c_issues(code):