For this Question: You are given an array of characters letters that is sorted in non-decreasing order, and a character target. There are at least two different characters in letters.

Return the smallest character in letters that is lexicographically greater than target. If such a character does not exist, return the first character in letters.<b>User Task:</b>
Since this will be a functional problem, you don't have to take input. You just have to complete the function <b>nextGreatestLetter()</b> that takes char array "letters" and char "target"  as parameters.

Note- In sample first char array is given in the form of string and in next line target char is given.

<b>Constraints:</b>
2 &le; letters.length &le; 10<sup>4</sup>
letters[i] is a lowercase English letter.
letters is sorted in non-decreasing order.
letters contains at least two different characters.
target is a lowercase English letter.Return true if num is a perfect square or false otherwise.Sample 1:
Input:
cfj
a
Output: 
"c"
Explanation: The smallest character that is lexicographically greater than 'a' in letters is 'c'.

Sample 2:
Input:
cfj
c
Output: 
"f"
Explanation: The smallest character that is lexicographically greater than 'c' in letters is 'f'.
, I have written this Solution Code: 
class Solution {
    public char nextGreatestLetter(char[] letters, char target) {
        int start=0;
        int end=letters.length-1;
        while(start<=end)
        {
           int mid=start+(end-start)/2;
            if(target<letters[mid])
            {
                
                 
                end=mid-1;
            }
            else
            {
                start=mid+1;
             
                
            }
        }
        return letters[start%letters.length];
        
        
    }
}
, In this Programming Language: Java, Now tell me if this Code is compilable or not?