NeetCode #33LC-281MediumArrays & HashingNC Algo100
← Back to All Problems

#33 · #281 · Zigzag Iterator(锯齿迭代器)

📌 Problem Statement & Constraints

Given two vectors v1 and v2, implement an iterator that returns their elements in alternating order, starting with v1. If one vector is exhausted, continue with the other. Implement next() and hasNext(). Constraints: 0 <= v1.length, v2.length <= 1000.
🔒

Sign In to Unlock Full Solutions for All 973 Problems

Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!