Skip to content

Missing Test Case - 744. Find Smallest Letter Greater Than Target #32638

@Jay9425

Description

@Jay9425

LeetCode Username

jayesh2211

Problem Number, Title, and Link

  1. Find Smallest Letter Greater Than Target

Bug Category

Problem examples

Bug Description

Best logical code for find smallest letter gretaer than target leetcode problem no.744

Language Used for Code

Java

Code used for Submit/Run operation

class Solution {
    public char nextGreatestLetter(char[] letters, char target) {
        
        int low=0;
        int high=letters.length-1;
        char ans=letters[0];

        while(low<=high){
            int mid=(low+high)/2;
            if(letters[mid]<=target){
                low=mid+1;
            }
            else{
                ans=letters[mid];
                high=mid-1;
            }
        }
        return ans;
    }
}

Expected behavior

.

Screenshots

Image

Additional context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions