Sha256: a8ae769845cdaddfb3aa20484c5368c247a300fd9a2ce17340294929be67260e
Contents?: true
Size: 538 Bytes
Versions: 159
Compression:
Stored size: 538 Bytes
Contents
require 'epitools/lcs' describe "Longest common subsequence" do it "works!" do prefix_strings = [ "shenanigans, gentlemen!", "shenanigans has been called", "shenanigans: a great restaurant." ] subsequence_strings = [ "i call shenanigans on you!", "shenanigans is a great restaurant.", "you like this? shenanigans!" ] longest_common_prefix(prefix_strings).should == "shenanigans" longest_common_subsequence(*subsequence_strings[0..1]).should == 12 end end
Version data entries
159 entries across 159 versions & 1 rubygems