Guest User

MastaP

a guest
Jan 19th, 2010
56
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. lastrev rs b = maximum [r | r <- rs, length r >= l && take l r == b] where l = length b
  2.  
  3. --*Main> lastrev ["1.1", "1.2", "1.3", "1.3.2.1", "1.3.2.3", "1.3.2.4", "1.3.4.1", "1.4", "1.5"] "1.3.2"
  4. --"1.3.2.4"
  5.  
RAW Paste Data