fungen_alt(starting,next,len)=List.tabulate(len,fnx=>ifxmod2=0thenstartingelsenext)fundiff([],[])=0|diff(x::xs,y::ys)=(ifx=ythen0else1)+diff(xs,ys)|diff(_,_)=~1(* List lengths don't match for some reason *)funlamps[]=0|lampsi=Int.min(diff(i,gen_alt(0,1,lengthi)),diff(i,gen_alt(1,0,lengthi)))
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Standard ML of New Jersey