(nums: Vec<i32>)
| 1 | pub fn pivot_index(nums: Vec<i32>) -> i32 { |
| 2 | let mindex = nums.len(); |
| 3 | for i in 0..mindex { |
| 4 | if &nums[0..i].iter().sum::<i32>() == &nums[(i+1)..].iter().sum::<i32>() { |
| 5 | return i as i32; |
| 6 | } |
| 7 | } |
| 8 | -1 |
| 9 | } |
| 10 | |
| 11 | fn main() { |
| 12 | let nums = vec![2,1,-1]; |
nothing calls this directly
no outgoing calls
no test coverage detected