# insort(sort順を崩さずに差し込む)

# Python

bisect.insort(items, v)
import bisect

items = [1, 2, 4, 5]
bisect.insort(items, 3)
print(items) # => [1, 2, 3, 4, 5]

[ 📩 ご意見 ]