def summarize_ranges(array):
res = []<EOL>if len(array) == <NUM_LIT:1>:<EOL><INDENT>return [str(array[<NUM_LIT:0>])]<EOL><DEDENT>i = <NUM_LIT:0><EOL>while i < len(array):<EOL><INDENT>num = array[i]<EOL>while i + <NUM_LIT:1> < len(array) and array[i + <NUM_LIT:1>] - array[i] == <NUM_LIT:1>:<EOL><INDENT>i += <NUM_LIT:1><EOL><DEDENT>if array[i] != num:<EOL><INDENT>res.append((num, array[i]))<EOL><DEDENT>else:<EOL><INDENT>res.append((num, num))<EOL><DEDENT>i += <NUM_LIT:1><EOL><DEDENT>return res<EOL>
:type array: List[int]
:rtype: List[]