add new solutions

This commit is contained in:
kanna5 2026-01-27 18:38:43 +09:00
parent 67cad91898
commit eb6ffe8114
No known key found for this signature in database
24 changed files with 933 additions and 14 deletions

View file

@ -0,0 +1,21 @@
package q744
func nextGreatestLetter(letters []byte, target byte) byte {
l, r := 0, len(letters)
for l < r {
m := (l + r) / 2
if letters[m] <= target {
l = m + 1
} else {
r = m
}
}
if l == len(letters) {
l = 0
}
return letters[l]
}
var _ = nextGreatestLetter