Challenge 1: Writing shortest — Possible Solution ==================================================================== fn shortest<'a>(x: &'a str, y: &'a str) -> &'a str { if x.len() < y.len() { x } else { y } } fn main() { let s1 = String::from("hello"); let s2 = String::from("hi"); let result = shortest(s1.as_str(), s2.as_str()); println!("Shortest: {}", result); } WHY THIS WORKS AS AN ANSWER ------------------------------ This directly mirrors this chapter's own longest function, with only two things changed: the comparison operator (< instead of >, since "shortest" means the smaller length wins instead of the larger one), and the returned branch accordingly. The lifetime annotation structure is identical, and for the identical reason: the function returns EITHER x or y depending on a runtime comparison, so the compiler cannot know in advance which parameter's lifetime the return value will actually be tied to — exactly the ambiguity this chapter's opening example demonstrated failing to compile without an explicit 'a. Both parameters share the SAME lifetime 'a, which correctly expresses that the returned reference is valid for at most as long as the SHORTER-LIVED of the two inputs — whichever one is actually returned, the annotation guarantees it's still valid for as long as the caller might use the result.