Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Max values in len range solution in Clear category for Replace with Biggest by kkkkk
from typing import Iterable
def replace_biggest(data: list[int]) -> Iterable[int]:
"""Return list with max value to the right of each element."""
return (
[max(data[idx + 1 :]) for idx in range(len(data) - 1)] + [-1]
if data
else []
)
Nov. 11, 2022
Comments: