20241024 finished.

This commit is contained in:
2024-10-24 09:08:13 +08:00
parent 3102da99a8
commit bce8de1c85
266 changed files with 2321 additions and 2014 deletions

View File

@@ -3,7 +3,6 @@
*/
pub struct Solution {}
// submission codes start here
impl Solution {
@@ -22,7 +21,7 @@ impl Solution {
path.pop();
} else {
path.push(name)
}
}
}
let mut result = String::new();
@@ -30,7 +29,7 @@ impl Solution {
for name in path {
result.push_str("/");
result.push_str(name);
}
}
if result.len() == 0 {
"/".to_owned()
@@ -48,6 +47,9 @@ mod tests {
#[test]
fn test_71() {
assert_eq!("/home".to_owned(), Solution::simplify_path("/home//".to_owned()));
assert_eq!(
"/home".to_owned(),
Solution::simplify_path("/home//".to_owned())
);
}
}