0 out of 464 challenges solved

Find Largest Negative Number

Write a Python function `largest_negative(numbers: list) -> int` that takes a list of integers and returns the largest negative number in the list. If there are no negative numbers, return `None`.

#### Example Usage
```python [main.nopy]
print(largest_negative([1, 2, 3, -4, -6]))  # Output: -4
print(largest_negative([1, 2, 3, -8, -9]))  # Output: -8
print(largest_negative([1, 2, 3, 4, -1]))   # Output: -1
print(largest_negative([1, 2, 3, 4]))       # Output: None
```

#### Constraints
- The input list will contain at least one integer.
- The function should handle both positive and negative integers.
def largest_negative(numbers: list) -> int:
    """
    Find the largest negative number in the list.

    Args:
    numbers (list): A list of integers.

    Returns:
    int: The largest negative number, or None if no negative numbers exist.
    """
    # Placeholder for the solution
    pass