makeArrayConsecutive2 | Python Solution | CodeFights

preview_player
Показать описание
Everyone can code!
------------------------------------------------------------------------
Hope you guys enjoyed the video, and remember to leave a comment down below if you have any questions. Like and subscribe if you enjoy these Python tutorials! :)
------------------------------------------------------------------------
Connect with me on Social Media! 💬
------------------------------------------------------------------------
------------------------------------------------------------------------
#Python #Tutorial #Programming #programmingforbeginners #pythontutorial #python3 #pythonbeginner
Рекомендации по теме
Комментарии
Автор

how about ?

def
statues.sort()
a = (max(statues) - min(statues))
b = ((a - len(statues)) + 1)
return b

Abhi_BRolling
Автор

It's much easier to use zip:

def
statues.sort()
res = 0
for i, j in zip(statues, statues[1:]):
res += j - i - 1
return res

СергейКочевряжин
Автор

Hi! Nice video! I am also doing python coding videos on code fights but for kids because I am ten years old. Great video! I subscribed! :)

aayushmitra
join shbcf.ru