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 - Наука та технологія
Did the groups alternate for you?
Good one larry. I have doubt in range of N + k-2. I didn't understand why we need to subtract 2. Thanks 😅
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.