(nums: &[i32])
| 1 | pub fn number_of_arithmetic_slices(nums: Vec<i32>) -> i32 { |
| 2 | if nums.len() < 3 { return 0; } |
| 3 | pub fn is_arithmetic(nums: &[i32]) -> bool { |
| 4 | let minus = nums[1] - nums[0]; |
| 5 | for i in 2..nums.len() { |
| 6 | if nums[i] - nums[i-1] != minus { return false; } |
| 7 | } |
| 8 | true |
| 9 | } |
| 10 | let mut ret = 0; |
| 11 | for length in 3..=nums.len() { |
| 12 | for i in 0..=nums.len() - length { |
no outgoing calls
no test coverage detected