DSA-Questions
DSA-Questions copied to clipboard
Finding the smallest letter greater than the target in Java
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"