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

  • @Algorithmist
    @Algorithmist Жыл бұрын

    Were you able to delete the right element?

  • @lollollollol1622
    @lollollollol1622 Жыл бұрын

    i like ur insights larry

  • @UnknownUnknown-wr8ly
    @UnknownUnknown-wr8ly Жыл бұрын

    Thanks for sharing your thoughts

  • @rosendo3219
    @rosendo321911 ай бұрын

    looks much cleaner than a sliding window approach. do you think all questions can be solved using this methodology vs sliding window?

  • @Algorithmist

    @Algorithmist

    11 ай бұрын

    I think it's just about learning the tools and the right time to use them..

  • @cuteandfunny9154
    @cuteandfunny9154 Жыл бұрын

    wow where is thtat drone shot?

  • @Algorithmist

    @Algorithmist

    Жыл бұрын

    Kyrgyzstan!

  • @rosendo3219

    @rosendo3219

    11 ай бұрын

    @@Algorithmist you visited everywhere except turkmenistan. how come?

  • @th2315
    @th2315 Жыл бұрын

    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

    @rosendo3219

    11 ай бұрын

    what makes you think your solution is cleaner than this one?

  • @hoangvacban
    @hoangvacban Жыл бұрын

    hello