diff --git a/solutions/collections/Vector.md b/solutions/collections/Vector.md index 903405a..2085844 100644 --- a/solutions/collections/Vector.md +++ b/solutions/collections/Vector.md @@ -96,6 +96,25 @@ fn main() { println!("Success!") } + + +//Another solution + +fn main() { + let mut v = Vec::from([1, 2, 3,4,5]); + for i in 0..5 { + println!("{:?}", v[i]) + } + + for i in 0..5 { + v[i] +=1; + } + + assert_eq!(v, vec![2, 3, 4, 5, 6]); + + println!("Success!") +} + ``` 5. @@ -215,4 +234,4 @@ fn main() { ip.display(); } } -``` \ No newline at end of file +```