DSA-Questions icon indicating copy to clipboard operation
DSA-Questions copied to clipboard

Finding the smallest letter greater than the target in Java

Open SwatiSrivastava216 opened this issue 4 years ago • 0 comments

Given a characters array (arr) that is sorted in non-decreasing order and a character (key), return the smallest character in the array that is larger than the key.

Sample Input: arr = ["c","f","j"] key = "a"

Sample Output: "c"

SwatiSrivastava216 avatar Oct 01 '21 04:10 SwatiSrivastava216