MCPcopy Create free account
hub / github.com/StudyRust/leetcode_rust / assemble

Function assemble

228-summary-ranges.rs:6–14  ·  view source on GitHub ↗
(current: Vec<i32>)

Source from the content-addressed store, hash-verified

4 return ret;
5 }
6 pub fn assemble(current: Vec<i32>) -> String {
7 if current.len() == 1 {
8 current[0].to_string()
9 } else {
10 let f = current.first().unwrap().to_string();
11 let l = current.last().unwrap().to_string();
12 vec!(f, "->".to_string(), l).join("")
13 }
14 }
15 let mut prev = nums[0];
16 let mut current = vec!(prev);
17 for num in &nums[1..] {

Callers 1

summary_rangesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected