fn main() { println!("Hello, world!"); } /** * // This is the MountainArray's API interface. * // You should not implement it, or speculate about its implementation * struct MountainArray; * impl MountainArray { * fn get(index:i32)->i32; * fn length()->i32; * }; */ struct MountainArray; impl MountainArray { fn get(self, index:i32)->i32; fn length(self)->i32; }; impl Solution { pub fn find_in_mountain_array(target: i32, mountainArr: &MountainArray) -> i32 { for i in 0..mountainArr.length() { if mountainArr.get(i) == target {return i;} } -1 } }