Skip to main content

longest_common_subsequence

Function longest_common_subsequence 

Source
pub fn longest_common_subsequence(s1: &str, s2: &str) -> String
Expand description

Find the longest common substring between s1 and s2.

Assumes s2 has all unique characters, enabling an index-based matching approach.

ยงExamples

Basic usage:

let result = algorithmz::map::longest_common_subsequence("abcdef","adcbef");
assert_eq!(result, "ef");