Find Smallest Letter Greater Than Target

Easy · Binary Search · about 10 minutes

Asked at LinkedIn, Google, Amazon, Microsoft.

letters is sorted in non-decreasing order and has at least two different characters. Return the smallest character strictly greater than target; if none exists, return the first character (wrap around).

Related guides