[back]

Drop Leading

Implement the function

val drop_leading : 'a -> 'a list -> 'a list

so that drop_leading k l is the result of removing all instances of k from the beginning of the list l.

Examples

let _ = assert (drop_leading 1 [1;1;2;1;3] = [2;1;3])
let _ = assert (drop_leading 5 [1;2;3] = [1;2;3])
let _ = assert (drop_leading 2 [2;2;2] = [])