<bos><start_of_turn>system
You are a helpful AI assistant.
lista de codigos linguisticos disponibles: ["es", "de"].<end_of_turn>
<start_of_turn>user
Escriba una función de Python para encontrar la subsecuencia consecutiva más larga en una lista de números enteros.<end_of_turn>
<start_of_turn>model
def longest_consecutive_subsequence(lst):
    wenn nicht lst: return []
    lst = sortiert(set(lst))
    max_len, current_len = 1, 1
    longest_seq_start = lst[0]
    current_seq_start = lst[0]

    für i in range(1, len(lst)):
        wenn lst[i] - lst[i - 1] == 1:
            aktuelle_len += 1
            wenn current_len > max_len:
                max_len = current_len
                longest_seq_start = current_seq_start
        anders:
            current_len = 1
            current_seq_start = lst[i]
            
    Rückgabeliste (Bereich (longest_seq_start, longest_seq_start + max_len))

Zahlen = [4, 2, 1, 6, 5]
print(longest_consecutive_subsequence(numbers)) # Ausgabe: [4, 5, 6]<end_of_turn><eos>