leetle

Daily challenge for 2026-03-22

446. Find First Element Greater Than Target

Given a sorted array of integers nums and an integer target, find the index of the *first* element in nums that is strictly greater than target. If no such element exists, return -1. The array is sorted in non-decreasing order. You must implement a solution with O(log n) time complexity, utilizing binary search.

Example:
Input: nums = [2, 5, 5, 8, 10], target = 5
Output: 3 (Index of 8)

Input: nums = [1, 3, 5, 7, 9], target = 10
Output: -1

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