I’ve been rereading the prompt for this question, and find it confusing. Pasting the prompt as is below:
Given an array of lowercase letters sorted in ascending order, find the smallest letter in the given array greater than a given ‘key’.
Assume the given array is a circular list, which means that the last letter is assumed to be connected with the first letter. This also means that the smallest letter in the given array is greater than the last letter of the array and is also the first letter of the array.
I bolded the parts that feel contradictory… So it’s an array in ascending order, from smallest letter to largest. Makes sense that the smallest letter of the array would be the first letter, but then it says the first letter is also greater than the last letter of the array. If it’s ascending order, how can that be possible? I understand that the goal is to create a cycle between the arr end to start, but maybe this wording could be clarified?
Type your question above this line.
Course: https://www.educative.io/collection/5668639101419520/5671464854355968
Lesson: https://www.educative.io/collection/page/5668639101419520/5671464854355968/4850551927865344