Search
Haskell, 51 49 bytes -2 bytes thanks to Wheat Wizard 1:g[2..] g(a:b)=a:g[d|(c,d)<-zip[1..]b,c`mod`a>0] Try it online!
Haskell, 78 bytes main=putStr$reverse$a++show a where a="main=putStr$reverse$a++show a where a=" Try it online!
JavaScript (Node.js), 60 bytes f=a=>console.log(`)(f;${[...f+``].reverse``.join``}=f`);f() Try it online!
Use the unpacking * instead of list If you want to convert an iterator/generator into a list, use the * operator instead of using the list function, e.g. Instead of list(iterable) Use [*iter...
Given a non-negative integer up to $999\,999\,999$, write it in English. The input number can be in any form other than English (though you'll typically want to use the native integer type of your...
Imagine you have only one byte (8 bits) to store a value, but need to store values from $0$ to $4032$. Impossible, until you are also told that an error of 1/64 of the exact value does not matter. ...
Sclipting, (UTF-16) 454 406 bytes Yes. 塊匱❸곴김分倘標⓶❹演긆륩닆롩닶밎併鈉不終⓷곴김剩❶갾밈分倘⓷標⓷❺演긇끨닷녳눖멤併鈉⓶不終갾밈剩❶뉀分倘⓷標⓷❺演긆둵닦끲뉖밄併鈉⓶不終뉀剩⓶글會⓶倘❷長是긆굮뉂밀⓶終긇끨늗긠뉦뭵댢걦늖눠댶땸긇꽥덦녮긆녩뉶될닦땮뉐❷굀瀰是❶銅긂건덶녮融壹坼❸겠分掘덇밉⓸겠剩倘껐⓶⓹逆⓸終終긆뭮뉒건덶묠덆둲뉖넠뉦뭵댢걦늗뉥긇꽩...
C# (.NET Core), 60 bytes class a{static void Main(){Console.Write("Hello, World!");}} Try it online!
As you might know, there were elections in Germany, and now the parties have to form a government coalition. Let's help them with it! A good coalition has the strict majority of seats (that is, mo...
Haskell, 141 bytes import Control.Monad f a=map(map fst)$filter(\c->let{g=map snd;e=sum(g a)`div`2;f=g c;d=sum f}in d>e&&all((<=e).(d-))f)$filterM(pure[1<0..])a Try it ...
Run-length encoding is a simple compression technique which compresses sequences of repeating identical bytes. The encoding rules for this task are as follows: Any sequence of $n$ identical bytes...
Python 3, 106 91 bytes Saved 15 bytes thanks to Moshi in the comments lambda a,b,c:[p for p in"+ - * // % **".split()if(p in'+-**'or b)and eval(f"{a}{p}{b}")==c] Try it online!
Use higher versions of Java Seriously, it's crazy what sort of features have been added since Java 8. I hardly recognize the language anymore... Examples: Constructing Lists Before, you had to ...
Japt, 26 25 bytes ;Bg4mUqL În10,2 ùT8 qT Îl Try it Long and unwieldy, I'm rusty. Looks at the first 0 in the bitstring of the first octet.
JavaScript, 43 bytes s=>"ABCDE"[Math.log2(s.slice(0,3)^255|8)^7] Try it online! Taking the first 3 characters of the string is always enough to include the first octet, while including at...
Scala, 41 bytes x=>2 to x forall(d=>x%d+math.sqrt(d)%1>0) Try it online! Pretty straightforward
Python3, 39 bytes lambda n:all(n%i**2for i in range(2,n)) Try it online! Makes a list comprehension from the numbers 2 through n of the remainder of the square, and then checks whether the lis...
Vyxal, 4 bytes K∆²a Try it Online! Outputs 0 for square-free, 1 for not. K # Factors ∆² # Is perfect square a # Any true?