๐Question 205:
What does this print?๐ฆ
fn main() {
let arr = [10, 20, 30];
let mut iter = arr.iter().rev();
println!("{:?}", https://t.co/YT1gR2dyna());
println!("{:?}", https://t.co/YT1gR2dyna());
}
๐ Question 203:
What is the output? ๐ฆ
fn main() {
let s1 = String::from("hi");
let s2 = String::from("rust");
let r: &str;
{
r = if s1.len() > s2.len() { &s1 } else { &s2 };
}
println!("{}", r);
}
๐ Question 201:
What does this program print? ๐ฆ
fn main() {
let mut s = String::from("rust");
{
let r = &mut s;
r.push_str("ace");
}
println!("{}", s);
}
๐ Question 200:
What will this print? ๐ฆ
```rust
fn main() {
let v = vec![1, 2, 3];
let iter = v.iter();
drop(v);
for x in iter {
println!("{}", x);
}
}
```
๐ Question 199:
In Rust, what happens when your landlord sells the house? Do you still get to be the tenant? ๐ฆ
```rust
fn main() {
let s1 = String::from("hi");
let s2 = &s1;
let s3 = s1;
println!("{}", s2);
}
```
๐Question 198:
What is the output?๐ฆ
fn main() {
let data = vec!["a", "bb", "ccc"];
let max = data.iter()
.max_by_key ( |s| s.len () )
.unwrap ();
println!("{}", max);
}