leetle

Daily challenge for 2026-08-27

604. Locate the First Empty Shelf

You are given a sorted array of integers shelves representing the IDs of shelves in a warehouse. A shelf is considered 'empty' if its ID is an odd number. The array is guaranteed to contain at least one odd-numbered shelf, and all odd-numbered shelves appear after all even-numbered shelves. Find and return the index of the first empty shelf.

Example:
Input: shelves = [2, 4, 6, 7, 9]
Output: 3

Run this challenge interactively in Python or JavaScript when the app loads.