(num: i32, nums2: &[i32])
| 3 | impl Solution { |
| 4 | pub fn next_greater_element(nums1: Vec<i32>, nums2: Vec<i32>) -> Vec<i32> { |
| 5 | pub fn next_greater(num: i32, nums2: &[i32]) -> i32 { |
| 6 | let mut flag = false; |
| 7 | for i in nums2 { |
| 8 | if i == &num { |
| 9 | flag = true; |
| 10 | } |
| 11 | if flag == true && i > &num { |
| 12 | return *i; |
| 13 | } |
| 14 | } |
| 15 | return -1; |
| 16 | } |
| 17 | nums1.iter().map(|num|next_greater(*num, &nums2)).collect::<Vec<i32>>() |
| 18 | } |
| 19 | } |
nothing calls this directly
no outgoing calls
no test coverage detected