General leetcode style easy to medium.
Given an unsorted list of integers nums, return the length of the longest sequence of consecutive integers. The sequence values must increase by exactly one, and the integers do not need to be adjacent in nums. Implement def longest_consecutive(nums):, accepting a list of integers and returning an integer.
def longest_consecutive(nums):