diff options
Diffstat (limited to 'next-greater-element-i/src')
| -rw-r--r-- | next-greater-element-i/src/main.rs | 17 | 
1 files changed, 17 insertions, 0 deletions
diff --git a/next-greater-element-i/src/main.rs b/next-greater-element-i/src/main.rs new file mode 100644 index 0000000..84ab40c --- /dev/null +++ b/next-greater-element-i/src/main.rs @@ -0,0 +1,17 @@ +fn main() { +    println!("Hello, world!"); +} + +struct Solution {} + +impl Solution { +    pub fn next_greater_element(nums1: Vec<i32>, nums2: Vec<i32>) -> Vec<i32> { +        let mut result = nums1.clone(); +        for i in result.iter_mut() { +            nums2.iter().position(|&x| x == *i); +        } + + +        result +    } +}  | 
