Datasets:
Tasks:
Text Generation
Modalities:
Text
Formats:
json
Languages:
English
Size:
< 1K
ArXiv:
Tags:
competitive-programming
code-generation
specification-generation
proof-generation
verification
rust
License:
File size: 393 Bytes
4c0e24e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | impl Solution {
pub fn find_min(nums: Vec<i32>) -> i32 {
let mut left: usize = 0;
let mut right: usize = nums.len() - 1;
while left < right {
let mid = left + (right - left) / 2;
if nums[mid] > nums[right] {
left = mid + 1;
} else {
right = mid;
}
}
nums[left]
}
}
|