Skip to main content
-8 bytes in C
Source Link
matteo_c
  • 7k
  • 15
  • 28

Python, 62 47 46 bytes

thanks to @Unrelated String for the idea of alternative input format

-1 byte thanks to @dingledooper

f=lambda p,n:0in(0in p[i::n]for i in range(n))

Attempt This Online!

C (GCC)C (gcc), 118118 110 bytes

-8 bytes thanks to @ceilingcat

d,i,j,n,l,c;main(c,v)char**v;{for(n=atoi(v[2]v++[2]);i<n;++i;c=i<n;d+=c){c=1;forfor(j=i;j<strlenj=i++;j<strlen(v[1]*v);j+=n)c&=v[1][j]c&=j[*v]-48;d|=c;}return48;return d;} 

Attempt This Online!Try it online!

Haskell, 50 48 bytes

-2 bytes thanks to @Unrelated String

p#n=any(\i->all(p!!)[i,i+n..length p-1])[0..n-1]

Try it online!

All the solutions do basically the same thing.

Python, 62 47 46 bytes

thanks to @Unrelated String for the idea of alternative input format

-1 byte thanks to @dingledooper

f=lambda p,n:0in(0in p[i::n]for i in range(n))

Attempt This Online!

C (GCC), 118 bytes

d,i,j,n,l,c;main(c,v)char**v;{for(n=atoi(v[2]);i<n;++i){c=1;for(j=i;j<strlen(v[1]);j+=n)c&=v[1][j]-48;d|=c;}return d;}

Attempt This Online!

Haskell, 50 48 bytes

-2 bytes thanks to @Unrelated String

p#n=any(\i->all(p!!)[i,i+n..length p-1])[0..n-1]

Try it online!

All the solutions do basically the same thing.

Python, 62 47 46 bytes

thanks to @Unrelated String for the idea of alternative input format

-1 byte thanks to @dingledooper

f=lambda p,n:0in(0in p[i::n]for i in range(n))

Attempt This Online!

C (gcc), 118 110 bytes

-8 bytes thanks to @ceilingcat

d,i,j,n,l,c;main(c,v)char**v;{for(n=atoi(v++[2]);c=i<n;d+=c)for(j=i++;j<strlen(*v);j+=n)c&=j[*v]-48;return d;} 

Try it online!

Haskell, 50 48 bytes

-2 bytes thanks to @Unrelated String

p#n=any(\i->all(p!!)[i,i+n..length p-1])[0..n-1]

Try it online!

All the solutions do basically the same thing.

-2 bytes (haskell)
Source Link
matteo_c
  • 7k
  • 15
  • 28

Python, 62 47 46 bytes

thanks to @Unrelated String for the idea of alternative input format

-1 byte thanks to @dingledooper

f=lambda p,n:0in(0in p[i::n]for i in range(n))

Attempt This Online!

C (GCC), 118 bytes

d,i,j,n,l,c;main(c,v)char**v;{for(n=atoi(v[2]);i<n;++i){c=1;for(j=i;j<strlen(v[1]);j+=n)c&=v[1][j]-48;d|=c;}return d;}

Attempt This Online!

HaskellHaskell, 5050 48 bytes

f p n=any(\i->all(p!!)[i,i+n..length p-1])[0..n-1]

-2 bytes thanks to @Unrelated String

p#n=any(\i->all(p!!)[i,i+n..length p-1])[0..n-1]

Try it online!

All the solutions do basically the same thing.

Python, 62 47 46 bytes

thanks to @Unrelated String for the idea of alternative input format

-1 byte thanks to @dingledooper

f=lambda p,n:0in(0in p[i::n]for i in range(n))

Attempt This Online!

C (GCC), 118 bytes

d,i,j,n,l,c;main(c,v)char**v;{for(n=atoi(v[2]);i<n;++i){c=1;for(j=i;j<strlen(v[1]);j+=n)c&=v[1][j]-48;d|=c;}return d;}

Attempt This Online!

Haskell, 50 bytes

f p n=any(\i->all(p!!)[i,i+n..length p-1])[0..n-1]

All the solutions do basically the same thing.

Python, 62 47 46 bytes

thanks to @Unrelated String for the idea of alternative input format

-1 byte thanks to @dingledooper

f=lambda p,n:0in(0in p[i::n]for i in range(n))

Attempt This Online!

C (GCC), 118 bytes

d,i,j,n,l,c;main(c,v)char**v;{for(n=atoi(v[2]);i<n;++i){c=1;for(j=i;j<strlen(v[1]);j+=n)c&=v[1][j]-48;d|=c;}return d;}

Attempt This Online!

Haskell, 50 48 bytes

-2 bytes thanks to @Unrelated String

p#n=any(\i->all(p!!)[i,i+n..length p-1])[0..n-1]

Try it online!

All the solutions do basically the same thing.

added Haskell solution
Source Link
matteo_c
  • 7k
  • 15
  • 28

Python, 62 47 46 bytes

thanks to @Unrelated String for the idea of alternative input format

-1 byte thanks to @dingledooper

f=lambda p,n:0in(0in p[i::n]for i in range(n))

Attempt This Online!

C (GCC), 118 bytes

d,i,j,n,l,c;main(c,v)char**v;{for(n=atoi(v[2]);i<n;++i){c=1;for(j=i;j<strlen(v[1]);j+=n)c&=v[1][j]-48;d|=c;}return d;}

Attempt This Online!

Haskell, 50 bytes

f p n=any(\i->all(p!!)[i,i+n..length p-1])[0..n-1]

All the solutions do basically the same thing.

Python, 62 47 46 bytes

thanks to @Unrelated String for the idea of alternative input format

-1 byte thanks to @dingledooper

f=lambda p,n:0in(0in p[i::n]for i in range(n))

Attempt This Online!

C (GCC), 118 bytes

d,i,j,n,l,c;main(c,v)char**v;{for(n=atoi(v[2]);i<n;++i){c=1;for(j=i;j<strlen(v[1]);j+=n)c&=v[1][j]-48;d|=c;}return d;}

Attempt This Online!

All the solutions do basically the same thing.

Python, 62 47 46 bytes

thanks to @Unrelated String for the idea of alternative input format

-1 byte thanks to @dingledooper

f=lambda p,n:0in(0in p[i::n]for i in range(n))

Attempt This Online!

C (GCC), 118 bytes

d,i,j,n,l,c;main(c,v)char**v;{for(n=atoi(v[2]);i<n;++i){c=1;for(j=i;j<strlen(v[1]);j+=n)c&=v[1][j]-48;d|=c;}return d;}

Attempt This Online!

Haskell, 50 bytes

f p n=any(\i->all(p!!)[i,i+n..length p-1])[0..n-1]

All the solutions do basically the same thing.

added C solution
Source Link
matteo_c
  • 7k
  • 15
  • 28
Loading
-1 byte
Source Link
matteo_c
  • 7k
  • 15
  • 28
Loading
-15 bytes
Source Link
matteo_c
  • 7k
  • 15
  • 28
Loading
Source Link
matteo_c
  • 7k
  • 15
  • 28
Loading