mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 17:34:49 +08:00
Pyupgrade to Python 3.9 (#4718)
* Pyupgrade to Python 3.9 * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
@ -7,10 +7,10 @@ to find the maximum of the array.
|
||||
(From Kleinberg and Tardos. Algorithm Design.
|
||||
Addison Wesley 2006: Chapter 5 Solved Exercise 1)
|
||||
"""
|
||||
from typing import List
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
def peak(lst: List[int]) -> int:
|
||||
def peak(lst: list[int]) -> int:
|
||||
"""
|
||||
Return the peak value of `lst`.
|
||||
>>> peak([1, 2, 3, 4, 5, 4, 3, 2, 1])
|
||||
|
Reference in New Issue
Block a user