Find length of longest consecutive sequence. Example: [100,4,200,1,3,2] => 4 (1,2,3,4)
Implement this function:
def longest_consecutive(lst: list) -> int:
Write the function only — the arguments are read for you and the return value is printed automatically.
Arguments arrive as one Python literal per line, in this order: lst.
Input
[100, 4, 200, 1, 3, 2]
Output
4