Slug: capstone-01 · Paired reading: Chapters 27 and 29
Prompt
Combine Result parsing and a classic hash/two-pointer task:
fn score_line(line: &str) -> Result<i32, &'static str> for
ok:N / err:msg, and fn two_sum(nums: &[i32], target: i32) -> Option<(usize, usize)>.
Contract
score_line:ok:<i32>→Ok;err:…→Err("error line"); other →Err("bad format"); bad number →Err("bad number")two_sum: first pair of indices(i, j)withi < j; empty / no pair →None