Leetcode with dani
Kanalga Telegram’da o‘tish
Join us and let's tackle leet code questions together: improve your problem-solving skills Preparing for coding interviews learning new algorithms and data structures connect with other coding enthusiasts
Ko'proq ko'rsatish1 258
Obunachilar
Ma'lumot yo'q24 soatlar
+17 kunlar
-730 kunlar
Postlar arxiv
1 258
Check out this AI browser perplexity browser
Discover a smarter way to browse! 🚀 Try the Perplexity Browser for lightning-fast answers, powerful AI tools, and next-level productivity. Perfect for work, study, and everyday browsing—share it with your friends and upgrade your internet experience today!
1 258
Repost from 「 Eyu core 」
Enjoy but don't get attached Give but dont expect Listen but dont judge Love but not depend and finally accept but dont settle
1 258
Don't ever save anything for a special occasion. Being alive is the special occasion.
— Mary Engelbreit
1 258
n, k = list(map(int, input().split()))
arr = list(map(int, input().split()))
bu = [0] * n
for i in range(len(arr) - 2, -1, -1):
bu[i] = abs(arr[i] - arr[i + 1]) + bu[i + 1]
for j in range(i + 2, min(i + k + 1, len(arr))):
bu[i] = min(abs(arr[i] - arr[j]) + bu[j], bu[i])
Endi mavjud! Telegram Tadqiqoti 2025 — yilning asosiy insaytlari 
