Search
Vyxal, 4 bytes Expects a string. O2%∑ Try it here! Explanation O2%∑ O ord 2% modulo 2 ∑ sum
65,535 The database field can already handle up to 65,535 (216 - 1) characters. Same for all post types and categories I don't see a need for different limits for questions and answers, or for d...
Haskell, 110 bytes c[]=1>0 c(a:b:_)|abs(a-b)==1=1<0 c(_:b)=c b f=0:1:zipWith(+)f(tail f) h=[g|g<-f,c.map fromEnum.show$g] r=(h!!) Try it online!
JavaScript, 25 bytes Input as an array of digits a=>a.map(x=>t+=x%2,t=0)|t Try it online! 26 bytes With input as a string (or an array of digit strings). f=([d,...a])=>d?d%2+f(a):0...
Japt -mx, 2 1 byte u Try it u :Implicit map of input array u :Modulo 2 :Implicit output of sum of resulting array
Python, 37 27 bytes First, with input as an integer: lambda i:sum(ord(x)&1for x in str(i)) This converts the number to string (in the base-10 default) and processes each character. It expl...
Given a positive integer, count its odd digits. Input An integer from 1 to 999,999,999, inclusive, in any of the following formats: A number (such as an integer or floating point number), li...
Given an integer from 1 to 1000, indicate whether it is a centered hexagonal number[1] (also known as a hex number). What is a hex number? The hex numbers can be visualised as follows: On a he...
Given 3 points, output one that is separated from its nearest neighbour by the largest distance. Input 3 distinct points (that is, no 2 points are in the same position). Each point is a pair o...
Haskell, 271 bytes import Data.Char import Data.List n=" IVXLCDM" r x=maximum[if(s`isInfixOf`x)then s else"A"|s<-words$concat$map(\x->(n!!div x 8):[(n!!(x-8*(div x 8)))])$map(\x->ord...
Bash, 205 bytes for s in C{C{CC,D,M},DC,MC} {CM,DC,D}{D,M} I{C,D,I{II,V,X},L,M,VI,X{C,I,L,V,X}} L{C,D,L,M,XC,XL} MMMM V{C,D,IV,IX,L,M,V,X} X{C{C,D,L,M,X},D,LX,M,X{C,L,XX}} do echo $1|grep -q $s...
A limit of 1 character for Challenges and Sandbox Now that Monica has pointed out that adjusting the minimum is already possible per category, I propose that we leave the minimum at 15 characters ...
Dyalog APL, 10 bytes ⊢∊1+\⍤,6×⍳ Port of lyxal's Vyxal answer. Explanation ⊢∊1+\⍤,6×⍳...
Something I would like to see here are explicit and specific constraints on how submitted solutions are expected to accept the challenge input and output their solutions (if output is the goal). F...
Rust, 258 254 bytes Saved four bytes thanks to trichoplax. fn v(s:&str)->&str{for b in "CCCC CCD CCM CDC CMC CMD CMM DCD DCM DD DM IC ID IIII IIV IIX IL IM IVI I...
AWK, 80 bytes {split("I V X L C D M 1 5 10 50 100 500 1000",d);for(;d[++i]!=$1;);print d[i+7]} Try it online! A quick map function. 'split' breaks the string into array elements. Find the stri...
K (oK), 9 bytes {x#0}'!10 Try it online! !10 / pass range your arbitrary number .' / treat those as a list, and evaluate each separately { } / main function...
AWK, 82 bytes {split($1,d,"");i=a=d[1];for(x in d){d[x]>a?a=d[x]:0;d[x]<i?i=d[x]:0}print a+i+$1} Try it online! Just pass your input, e.g.: echo "123" | awk '...'
Python 3, 49 bytes lambda m,n:[[*range(n*_,n*_+n)]for _ in range(m)] Try it online!
Python 2, 46 bytes lambda m,n:[range(n*_,n*_+n)for _ in range(m)] Try it online!
C (gcc), 59 bytes i;f(m,n){while(i<m*n){putchar(i%n?32:13);putchar(48+i++);}} Attempt This Online! m is the number of rows. n is the number of columns.
BQN (CBQN), 10 bytes Anonymous function that takes m on the left and n on the right. {𝕨‿𝕩⥊↕𝕨×𝕩} ↕𝕨×𝕩 # list of range [0,m*n) 𝕨‿𝕩⥊ # reshape list to m*n Try it here!