1493. Longest Subarray of 1's After Deleting One Element - Day 5/31 Leetcode July Challenge
Ғылым және технология
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!
Problem: leetcode.com/problems/longest-subarray-of-1s-after-deleting-one-element/description/
Twitch: www.twitch.tv/larryny
Discord: discord.gg/6QKRCdR
Instagram: larrysomewhere
#leetcode #coding #programming
Пікірлер: 12
Were you able to delete the right element?
i like ur insights larry
Thanks for sharing your thoughts
looks much cleaner than a sliding window approach. do you think all questions can be solved using this methodology vs sliding window?
@Algorithmist
11 ай бұрын
I think it's just about learning the tools and the right time to use them..
wow where is thtat drone shot?
@Algorithmist
Жыл бұрын
Kyrgyzstan!
@rosendo3219
11 ай бұрын
@@Algorithmist you visited everywhere except turkmenistan. how come?
I found a super clean solution, however, I can't really understand it, can someone explain it: def longestSubarray(nums): count = l = 0 for r in nums: if not r: count += 1 if count > 1: if not nums[l]: count -= 1 l += 1 return len(nums)-l-1
@rosendo3219
11 ай бұрын
what makes you think your solution is cleaner than this one?
hello