1 2 3 4 5 6 7 8 9 10 11 12
fn main() { println!("Hello, world!"); } struct Solution {} impl Solution { pub fn search_insert(nums: Vec<i32>, target: i32) -> i32 { nums.partition_point(|&x| x < target) as i32 // nums.binary_search(&target).unwrap_or_else(|x| x) as i32 } }