Facebook
From Toxic Camel, 3 Years ago, written in OCaml (Objective Caml).
This paste is a reply to Untitled from Speedy Porcupine - view diff
Embed
Download Paste or View Raw
Hits: 107
  1. let matrix m =                                  
  2.   let remove_first_two = function                
  3.   | (h1 :: h2 :: t) -> List.rev t                
  4.   | _ -> raise (Invalid_argument "invalid list")
  5.   in                                            
  6.   let remove_last = function                    
  7.     | h :: t -> List.rev t                      
  8.     |_ -> raise (Invalid_argument "invalid list")
  9.   in remove_last (remove_first_two m)            
  10.