New answers tagged

1

R, 169 bytes function(x)any(unlist(lapply(1:2,function(m)apply(apply(x,m,function(y,r=rle(y))rep(r$l*r$v,r$l)),1,function(a)tapply(a,cumsum(!a),function(d)sort(e<-d[!!d])<seq(e)))))) Try it online! An R translation of my Jelly answer. I’m not sure it’s much easier to follow! Takes a matrix of 0s and 1s and returns a logical scalar (FALSE if Latin, ...


6

Jelly, 24 bytes ,ZµŒgaS$€F)Zṣ€0Ṣ<JƊ€€)FẸ Try it online! A monadic link taking as its argument the grid as a matrix with 1 representing squares needing a number and 0 representing the spacers. Returns 0 if the grid is Latin and 1 if not. Explanation Main link, takes a matrix of 1s and 0s as its argument, z , | Pair with: Z ...


Top 50 recent answers are included