Longest common suffix
Your task
A build tool groups artifacts by shared name endings. Given a list of file names, return their longest common suffix, the longest string that every name ends with. Return an empty string if the list is empty or the names share no common ending. For example, ['report_final.txt', 'summary_final.txt', 'final.txt'] share the suffix 'final.txt'.
Examples
common_suffix(names: list[str]) -> strExample 1
Input
common_suffix(["report_final.txt", "summary_final.txt", "final.txt"])Output
"final.txt"