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,10 +3,8 @@ pub struct Solution;
impl Solution {
pub fn count_prefix_suffix_pairs(words: Vec<String>) -> i32 {
let mut result = 0;
let words: Vec<Vec<char>> = words.iter()
.map(|s| {s.chars().collect()})
.collect();
let words: Vec<Vec<char>> = words.iter().map(|s| s.chars().collect()).collect();
for j in 1..words.len() {
for i in 0..j {
if Solution::is_prefix_and_suffix(&words[i], &words[j]) {
@@ -36,4 +34,4 @@ impl Solution {
true
}
}
}

View File

@@ -41,7 +41,5 @@ mod tests {
use super::*;
#[test]
fn test_385_2() {
}
}
fn test_385_2() {}
}