Advertisement
Guest User

Untitled

a guest
Dec 19th, 2015
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.77 KB | None | 0 0
  1.  
  2. module StringSet = Set.Make(
  3.     struct
  4.         type t = String
  5.         let compare = Pervasives.compare
  6.     end
  7. )
  8.  
  9. module StringSetUtils =
  10.     struct
  11.  
  12.         let leidub_aga (s_set) =
  13.             if not (StringSet.is_empty(s_set)) then (
  14.                 let set = ref(s_set) in
  15.                 let el = ref(StringSet.min_elt(s_set)) in
  16.                 set := StringSet.remove !el !set;
  17.  
  18.                 while not (StringSet.is_empty(!set)) && !el == "" do
  19.                     el := StringSet.min_elt(!set);
  20.                     set := StringSet.remove(!el, !set);
  21.                 done;
  22.  
  23.                 if !el != "" then (
  24.                     String.get(!el, 0) == 'a'
  25.                 ) else
  26.                     false
  27.             );
  28.             false
  29.  
  30.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement