3208. Alternating Groups II (Leetcode Medium)

Поділитися
Вставка
  • Опубліковано 5 лип 2024
  • 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/alterna...
    Twitch: / larryny
    Discord: / discord
    Instagram: / larrysomewhere
    #leetcode #coding #programming
  • Наука та технологія

КОМЕНТАРІ • 3

  • @Algorithmist
    @Algorithmist  5 днів тому +1

    Did the groups alternate for you?

  • @kshyamkumarreddy4916
    @kshyamkumarreddy4916 5 днів тому

    Good one larry. I have doubt in range of N + k-2. I didn't understand why we need to subtract 2. Thanks 😅

    • @Algorithmist
      @Algorithmist  5 днів тому

      Ah, I talk about this for maybe 5 seconds so it's easy to miss - but it is just because I compare it from i to i + 1, and the last element should be N + K - 1.