1802. Maximum Value at a Given Index in a Bounded Array (Leetcode Medium)

preview_player
Показать описание
Larry solves and analyzes this Leetcode problem as both an interviewer and an interviewee. This is a live recording of a real engineer solving a problem live - no cuts or edits!

#leetcode #coding #programming
Рекомендации по теме
Комментарии
Автор

how to improve my thinking approach larry
its hard for me to understand question during contest round

-siddharthsattyam
Автор

hi Larry why I can't do this in the binary search part
while left<right:
mid=(left+right)//2
if helper(mid)<=maxSum:
left=mid+1
else:
right=mid-1
return mid

this part gives me wrong answer, and I couldn't figure out why

huaxingwang
Автор

I know of the n*(n+1)//2 formula. Is this n*(n-1)//2 some new derivation?

bismeetsingh
visit shbcf.ru