Improve vecs2 comments for beginners

#2221
Simplified TODO comment and added hint for beginners.
This commit is contained in:
Krishna Kumar 2026-03-29 11:48:20 +05:30 committed by GitHub
parent 37cbcd9049
commit 61368257be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,8 +2,9 @@ fn vec_loop(input: &[i32]) -> Vec<i32> {
let mut output = Vec::new(); let mut output = Vec::new();
for element in input { for element in input {
// TODO: Multiply each element in the `input` slice by 2 and push it to // TODO: Loop through each number in `input`,
// the `output` vector. // multiply it by 2, and add it to the `output` vector.
// Hint: Use a `for` loop and the `push` method.
} }
output output