Search a list: Difference between revisions

m
mNo edit summary
Line 4,365:
 
fn main() {
mut list, mut index, mut count, mut missing := "", "", "", ""
for nee in needles {
for idx, hay in haystacks {
Line 4,378:
list += "Found: ${nee}; Index: ${index}; Count: ${count}\n"
}
}
}
if nee !in haystacks && !missing.contains(nee) {missing += "Missing: ${nee}\n"}
}
list += missing
println(list.all_before_last('\n'))
}
Line 4,389 ⟶ 4,391:
Found: Bush; Index: 4, 7; Count: 2
Found: Wally; Index: 2; Count: 1
Missing: washington
</pre>
 
291

edits