leetcode

Log | Files | Refs | README

commit fe8e30e5f0b01c424cb09d05270b3e7d56b662fe
parent 9224a655cc914f60cc715389f4159d0915b510a3
Author: ling0x <ling0x@users.noreply.github.com>
Date:   Sun, 26 Jul 2026 17:18:10 +0100

update

Diffstat:
Msrc/array/longest_common_prefix.rs | 15++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/src/array/longest_common_prefix.rs b/src/array/longest_common_prefix.rs @@ -130,13 +130,21 @@ fn solution_3(strs: Vec<String>) -> String { } } + info!("Common: {common:?}"); + String::from_iter(common) } +// Fourth try: +// Can we use less than 2.1mb memory? +fn solution_4(strs: Vec<String>) -> String { + String::new() +} + #[cfg(test)] mod tests { use crate::{ - array::longest_common_prefix::{solution_1, solution_2, solution_3}, + array::longest_common_prefix::{solution_1, solution_2, solution_3, solution_4}, test_utils::benchmark::init_benchmark_tracing, }; @@ -207,4 +215,9 @@ mod tests { fn solver_3() { run_solver_cases(solution_3, full_cases()); } + + #[test] + fn solver_4() { + run_solver_cases(solution_4, full_cases()); + } }