474. 一和零
This commit is contained in:
+7
-1
@@ -1,3 +1,9 @@
|
||||
pub fn make_string_arr(s: &str) -> Vec<String> {
|
||||
s.trim_matches(&['[', ']'][..])
|
||||
.split(',')
|
||||
.map(|s| s.trim_matches(&['"',' ']).to_string())
|
||||
.collect()
|
||||
}
|
||||
pub fn make_arr(s: &str) -> Vec<i32> {
|
||||
s.trim_matches(&['[', ']'][..])
|
||||
.split(',')
|
||||
@@ -72,4 +78,4 @@ pub fn make_matrix(s: &str) -> Vec<Vec<i32>> {
|
||||
}
|
||||
|
||||
rows
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user