leetcode

Log | Files | Refs | README

commit 430b143c71fb36f6120fb32bc2b79618d0be2da2
parent f240500d976c7dd3c34bb77c458c4203cc22d532
Author: ling0x <ling0x@users.noreply.github.com>
Date:   Tue, 21 Apr 2026 23:44:33 +0100

exercise

Diffstat:
Msrc/array/longest_common_prefix.rs | 16+++-------------
1 file changed, 3 insertions(+), 13 deletions(-)

diff --git a/src/array/longest_common_prefix.rs b/src/array/longest_common_prefix.rs @@ -1,10 +1,6 @@ -use std::collections::HashSet; - -use tracing::info; - pub fn longest_common_prefix(strs: Vec<String>) -> String { - let mut seen = HashSet::<char>::new(); - let mut seen_seen = HashSet::<char>::new(); + let mut seen = std::collections::HashSet::<char>::new(); + let mut seen_seen = std::collections::HashSet::<char>::new(); let mut common = Vec::<char>::new(); let mut common_common = Vec::<char>::new(); @@ -25,13 +21,7 @@ pub fn longest_common_prefix(strs: Vec<String>) -> String { } } - info!("Seen: {:?}", seen); - info!("Common: {:?}", common); - info!("Seen seen: {:?}", seen_seen); - info!("Common common: {:?}", common_common); - - let result = String::from_iter(common_common); - result + String::from_iter(common_common) } #[cfg(test)]