Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Sort, then use abs diff solution in Clear category for The Final Stone by kkkkk
def final_stone(stones: list[int]) -> int:
"""Return stone weight after repetitively subtracting largest stones."""
weight = 0
for stone in sorted(stones, reverse=True):
weight = abs(weight - stone)
return weight
Sept. 21, 2022
Comments: