Sha256: 92ac83f636794c66dabf3a43ffaa7b311133b1f3020f148837353bdeebdf5945
Contents?: true
Size: 524 Bytes
Versions: 27
Compression:
Stored size: 524 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
27 entries across 27 versions & 1 rubygems