Read lines from a very large file in Python.
Asked in the Round 3 stage. Author notes generators would have been the better answer, but this grading contract requires the function to return a materialized list.
Implement def read_lines(lines):, where lines is a list of strings representing lines read from a file. Return a list with each trailing or \r removed. Preserve leading spaces, trailing spaces before the newline, blank lines, and final lines without a newline.
lines is a list of strings.\n or \r\n.def read_lines(lines):