Skip to content

Commit

Permalink
56: Improve
Browse files Browse the repository at this point in the history
  • Loading branch information
sankichi92 committed Dec 29, 2023
1 parent f39e3de commit 1b73428
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions 56-koko-eating-bananas/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
pub fn min_eating_speed(mut piles: Vec<i32>, h: i32) -> i32 {
piles.sort_unstable();

let (mut left, mut right) = (1, *piles.last().unwrap());
pub fn min_eating_speed(piles: Vec<i32>, h: i32) -> i32 {
let (mut left, mut right) = (1, *piles.iter().max().unwrap());
'bsearch: loop {
let mid = left + (right - left) / 2;

Expand Down

0 comments on commit 1b73428

Please sign in to comment.