instruction stringlengths 34 53.1k |
|---|
This challenge is to produce the shortest code for the constant \$\pi^{1/\pi}\$. Your code must output the first \$n\$ consecutive digits of \$\pi^{1/\pi}\$, where \$n\$ is given in the input. Alternatively, your program may accept no input, and output digits indefinitely
This is code golf, so the shortest submission ... |
Thanks, Uncle (the story)
My slightly mad uncle recently left for the space colonies, and passed his pallet goods business to me. The rectangular warehouse is full of pallets of goods except for the one square by the door, and I've just received the first list of pallets ordered by customers to be sent out today.
Fortu... |
The gravitational force is a force that attracts any two objects with mass. In this challenge our objects will be Numbers and their mass will be their value. To do so, we don't care about the strength of the force but the direction of it.
Imagine this set of numbers
[1 6 9 4 6 9 7 6 4 4 9 8 7]
Each of them creates a ... |
We all know the classic dad joke that goes something like this:
Somebody says a sentence to describe their self (e.g. I'm tired or I'm confused).
A dad-joke enthusiast comes along and replies Hi <adjective>, I'm Dad!, because introductions follow the same format (I'm Peter follows the same format as I'm hungry).
Yo... |
It was a dark and stormy night. Detective Havel and Detective Hakimi arrived at the scene of the crime.
Other than the detectives, there were 10 people present. They asked the first person, "out of the 9 other people here, how many had you already met before tonight?" The person answered "5". They asked the same questi... |
Warning: This is a bit lengthy
I have decided to build my own random function I call it "Random Cake"
This function should get an integer value between 0 and 99999
Ingredients
1 x DateTime function
1 x Sin : Radians
1 x Absolute Value
1 x π
a dash of multiplication, division and addition
Here is the recipe
Reci... |
In your grandparents' day, dialing a phone number was done with a rotary dial like this:
To dial each digit, put your finger in the corresponding hole, pull it over to the finger stop, and release it. A mechanism will cause the dial to spin back to its resting position, and the phone will disconnect and reconnect a c... |
Given a list of at least two words (made only of lowercase letters), construct and display an ASCII ladder of the words by alternating the direction of writing first to the right, then to the left, relatively to the initial direction from left to right.
When you finish writing a word, change the direction and only then... |
Introduction
In many programming languages, within syntax exceptions, it is often pointed out to the programmer exactly which character or line is the culprit. This challenge will be a bit of a modification of that - specifically, using an arrow to point out any specific character of an input string.
The challenge
Your... |
Introduction
It is somewhat like DVORAK Keyboard layout , but MUCH harder.
Let's talk about the Korean keyboard first. As you can see in Wikipedia, there is a Kor/Eng key to change between Korean and English key sets.
Koreans sometime type wrong : they attempt to write in Korean on a qwerty keyboard or in English on a ... |
Suppose there are 5 positive integers in an array or list as 14, 12, 23, 45, 39.
14 and 12 cannot be taken in the subset as 1 is common in both. Similarly {12, 23}, {23, 39}, {14, 45} cannot be included in the same subset.
So the subset which forms the maximum sum is {12, 45, 39}. The maximum sum such formed is 96.
the... |
I use "sentence" here loosely to mean "any sequence of words separated by spaces" and "words" to mean "sequences of alphanumeric (hexatrigesimal) characters unseparated by spaces".
Conversion is from base-36 (0123456789abcdefg...) or (0123456789ABCDEFG...)
Conversion to base-16 (0123456789abcdef) or (0123456789ABCDEF)... |
Your task is to modify the original Plan 9 cat tool for UNIX, in order to make it a fully turing complete language interpreter. You may make use of ANSI escape codes and the backspace character (\x08) to aid in this.
You must submit:
A modified version of the Plan 9 cat tool
A hexdump of the turing machine that can be... |
It is Restricted Integer Partitions, but with maximum number.
Question
Three positive integers are given. First number is number to divide, second number is length of partition, and third number is maximum number. First number is always largest, and bigger than other two.
For example, 5, 2, 3. Then, make partition of 5... |
Context:
Gynvael Coldwind, a famous security researcher, published a contest in his blog post (that is now complete). The goal was similar to the one described here, but with certain restrictions depending on which of the three allowed programming languages was chosen. I found the exercise fun and wanted to extend the ... |
Introduction:
In Dutch, the words leading and suffering, being 'leiden' and 'lijden' respectively, are pronounced the same way. One is written with a "short ei", and one with a "long ij", as we Dutchman would say, but both 'ei' and 'ij' are pronounced [ɛi].
Challenge:
Given a list of numbers, determine which (if any) a... |
It is ancient knowledge that every non-negative integer can be rewritten as the sum of four squared integers. For example the number 1 can be expressed as \$0^2+0^2+0^2+1^2\$. Or, in general, for any non-negative integer \$n\$, there exist integers \$a,b,c,d\$ such that
$$n = a^2+b^2+c^2+d^2$$
Joseph-Louis Lagrange pro... |
Challenge:
Input:
A sorted list of positive integers.
Output:
The amount of integers which are still at the exact same index, after rotating the digits in each integer its index amount of times towards the left and sorting the modified list again.
Example:
Input: [8,49,73,102,259,762,2782,3383,9217,37846,89487,7471788]... |
Your task is to, given two positive integers, \$x\$ and \$n\$, return the first \$x\$ numbers in the incremental ranges sequence.
The incremental range sequence first generates a range from one to \$n\$ inclusive. For example, if \$n\$ was \$3\$, it would generate the list \$[1,2,3]\$. It then repeatedly appends the la... |
Challenge
I'm under attack by the larcenous Midnight Crew and I need to summon the Catenative Doomsday Dice Cascader in order to defend myself. Since I'm low on space, I need the code to be as short as possible.
The algorithm for the Catenative Doomsday Dice Cascader is as follows:
First, the six sided die in the Prime... |
I'm stuck on a problem involving the Gale-Ryser Theorem. The problem's input gives me the row-wise sum of an hv-convex binary matrix(n*m).
e.g. I get {4,3,2,2,1} in the input. It's the row wise sum of the following matrix:
1 1 1 1
1 1 1 0
1 1 0 0
1 1 0 0
1 0 0 0
To solve the problem, I have to fin... |
disclaimer: I'm not aware of any non-bruteforce solutions
A Graeco-Latin square is, for two sets of same length \$n\$, a \$n \times n\$ arrangement of cells, each containing a unique (across the entire square) pair of a element of the first set and a element of the second set, such that all first elements and all sec... |
Challenge:
Given a list of multi-line strings, overlap them (in the top-left) and output the result.
Example:
Input: ["aaaa\naaaa\naaaa\naaaa","bb\nbb\nbb","c"]
Output:
cbaa
bbaa
bbaa
aaaa
Challenge rules:
Input-format is flexible. You are allowed to get the input as a 2D list of lines (i.e. [["aaaa","aaaa","aaaa","a... |
Background
There are self-extracting .ZIP files. Typically they have the extension .EXE (and by executing the file they will be extracted) but when renaming them to .ZIP, you can open the file with some ZIP extracting software.
(This is possible because .EXE files require a certain header but .ZIP files require a certa... |
Introduction:
I collect twisty puzzles. Most twisty puzzles are produced and sold by Chinese companies. Most well-known companies ask permission from puzzle designers to produce their designs and work together towards a product on the market. In this case, puzzle designers are of course very happy and proud that one of... |
The Steenrod algebra is an important algebra that comes up in algebraic topology. The Steenrod algebra is generated by operators called "Steenrod squares," one exists for each positive integer i. There is a basis for the Steenrod algebra consisting of "admissible monomials" in the squaring operations. It is our goal to... |
This code golf challenge is to show directions through numbers.
When the user enters a number, then that means a direction change as follows:
0 means stay still
1 means forward (initially from left to right and initially start with `:`)
2 means turn right
3 means turn left
4 means go backward
I will show you an exampl... |
Challenge
Bar Dice is a simple game played in a Bar with Dice (hence the name). You roll 5 six-sided dice and attempt to make the best hand.
Scoring is based on amassing the largest number of dice with the same digits. Each hand must include at least a single "Ace", or one, in order to be a valid hand; Aces act as "w... |
Here's yet another Steenrod algebra question. Summary of the algorithm: I have a procedure that replaces a list of positive integers with a list of lists of positive integers. You need to repeatedly map this procedure over a list of lists and flatten the output until you reach a fixed point. Then for each sublist, if i... |
Not exactly sure if it belongs in this site, but I always have trouble thinking of all the certain edge cases in any kind of competitive programming or puzzles.
For example, take this kind of problem
Find the size of the smallest list of squares that add up to n
f(16)-> 1 (16)
f(17)-> 2 (16+1)
One intuitive approach ... |
JonoCode9374 had almost completely implemented my language EnScript except for the CHS command. I was impatient of waiting for them to implement this command, so I chose to put this question here.
Challenge:
Write a solution that takes an input and returns the chased output. Standard loopholes are forbidden.
This is th... |
The aim of this challenge is to find an impossibly short
implementation of the following function p, in the langage of your
choosing. Here is C code implementing it (see
this TIO link that also prints its outputs) and a wikipedia page containing it.
unsigned char pi[] = {
252,238,221,17,207,110,49,22,251,196,250,2... |
I suspect Gomoku may be one of the simplest games to implement in code. https://en.wikipedia.org/wiki/Gomoku The game is this: players BLACK and WHITE take turns putting down black and white stones. Black traditionally goes first. If, when a player puts down their stone, they now have 5 in a row of their color, they wi... |
Write a program that reads a string, and inserts commas to divide large numbers in groups of 3. i.e. 10000 => 10,000. It should 'fix' incorrectly formatted numbers as described below.
It must work for all numbers on the same line
It should not modify numbers after a decimal point. i.e. 1234.5678 => 1,234.5678
Leading... |
A magic word is a word whose Braille spelling contains precisely 26 dots (because the Morse code alphabet can be circularly encoded within). For example:
⠎ ⠝ ⠥ ⠛ ⠛ ⠇ ⠽ snuggly
⠏ ⠕ ⠇ ⠽ ⠛ ⠕ ⠝ polygon
⠝ ⠥ ⠛ ⠛ ⠑ ⠞ ⠽ nuggety
⠽ ⠕ ⠛ ⠓ ⠥ ⠗ ⠞ yoghurt
are all magic words.
Objective:
Craft a program to identify 77 such mag... |
Specifications
Given a number n, output an ASCII "meme arrow" (greater-than symbol, >) of size n.
n will always be a positive integer, greater than 0.
Examples
n = 2
\
\
/
/
n = 5
\
\
\
\
\
/
/
/
/
/
Sample code
Here is a sample program, written in Crystal, that returns the correct results. Run... |
Gimbap(김밥) is Korean food, somewhat looks like sushi roll.
Here is Korean emoticon represent Gimbap : @))))))))))
Your quest is make ASCII Gimbap cutter.
Rule
Input is string made with only @ and ).
Output cuts every valid Gimbap with ), and then add @ between them. So for example @)) to @) @).
Valid Gimbap starts wi... |
Challenge
Given a 2D array, find the length and direction of all the longest consecutive characters.
If there are ties, output every possible winning combination in any order, (winners can overlap with other winners)
Zero "0" is a special padding character which cannot be a winner.
Code golf rules apply, shortest code... |
This challenge is inspired by a series of young children's books by Fiona Watt and Rachel Wells, which I've recently been enjoying with my daughter.
In each book a mouse (illustrated, but not part of the text) complains that a succession of 5 things of the same type are not its thing. It then backs this up by declarin... |
This seems almost trivial, but since after some effort I was not able to beat the literal solution in J, I thought it might make a decent challenge (though, to be clear, this is not a J-specific challenge).
Title says it all. You simply need to write a program, or function (taking no arguments) that returns or prints:... |
Make a Number Expression is related : actually, it is also about Aheui. But it just made number expression, but this made real Aheui code.
Aheui is esolang written in only Korean character. Because of its nature, Aheui can't use Arabic numbers.
But, of course, there is way to generate number.
Brief introduction to Ahe... |
Reading the text of the millitext font
There is a font here that fits each character into a single, 1x5 pixel block. It does this (assuming you're using an LCD screen) by using the RGB channels of each pixel to expand the one pixel into three subcolumns, one for each channel. Your task is to take in a string of text en... |
You are tasked with displaying the string "ABCDEFGHIJKLMNOPQRSTUVWXYZ" and only that, except for trailing newlines if they're unavoidable.
You must not output any homoglyphic characters like Cyrillic A. You can use non-Unicode encodings, but just to be sure, only output the Latin letters.
Regardless of the encoding you... |
This is an answer-chaining challenge relating to the OEIS.
Oh, the justification for this is because a company needs one program to print out their OEIS sequences real bad and they have every language.
The answer-chaining format works in the following way:
Someone posts the first answer, from which all further solution... |
Output the Nth term of the Van Eck Sequence.
Van Eck Sequence is defined as:
Starts with 0.
If the last term is the first occurrence of that term the next term is 0.
If the last term has occurred previously the next term is how many steps back was the most recent occurrence.
https://oeis.org/A181391
https://www.you... |
The Nonary Game is a fictional game played in the video game trilogy of the same name. Your goal is to find how many players (at best) can escape a given game, in as few bytes of code as possible.
Rules of the game
There are 9 players, numbered 1 to 9.
All players start in the same room.
There are any number of doors,... |
Unless you have a userscript that modifies the site's design (or even if so), you should have noticed that we have our site design!
(It's November now)
So, to celebrate, let's make a program that retroactively applies this design (oversimplified, of course)!
So, the most important changes are:
our new name is now Code... |
Print the phrase And she said, 'But that's his.' using only the following characters: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ No punctuation or non-alphabetic characters whatsoever. You can use whatever programming language you want. Whitespace is completely allowed. Shortest program wins.
|
The narcissist is a program which, given its own source as input, prints a truthy value and, given anything other than that, prints a falsey value. Today, we're reversing this.
Create a program that, given the name of whatever your language's truthy value is (True, true, 1), prints its own source. Given the name of wha... |
Given two contiguous shapes of the same area, determine the optimal way to divide the first shape into a minimum number of contiguous segments such that they can be rearranged to form the second shape. In other words, find the minimum number of segments required that can form both of the shapes.
"Contiguous" means that... |
Create a program that, given an integer N, outputs the number of years we have to get to N A.D. or how many years it has been since N A.D, as a string or int. For example, given 2014, the program should output 5 as it has been that many years since 2014. Input of the year in which you run the program should result in 0... |
Make a program that outputs the number of seconds from the beginning of today (00:00:00 of the day you run it) to the second you ran it. However, if this number is divisible by three, print Fizz instead. If it is divisible by five, print Buzz instead. If it is divisible by three and five, print FizzBuzz.
Don't pad the ... |
In the board game Pandemic, an outbreak occurs when a city contains more than 3 disease cubes. When the outbreak occurs, any disease cubes in the city in excess of 3 are removed, and each city connected to it gains one disease cube. This means that chain reactions can, and will occur.
Important note: Each city may onl... |
The Sixers sequence is a name that can be given to sequence A087409. I learned about this sequence in a Numberphile video, and it can be constructed as follows:
First, take the multiples of 6, written in base 10:
6, 12, 18, 24, 30, 36, ...
Next, concatenate the numbers into a stream of digits:
61218243036...
Finally, r... |
Make a snake fill any maze (until it gets stuck).
The snake
The snake starts at a given starting point, pointing EAST. It moves by always having a wall or a part of its body immediately to the LEFT of its head ("left-hand rule wall follower"), until it gets stuck because all four directions around its head are occupied... |
The new site header has some bits of source code from various questions as the background. Here are the first 3 lines:
--<-<<+[+[<+>--->->->-<<<]>]<<--.<++++++.<<-..<<.<+.>>.>>.<<<.+++.>>.>>-.<<<+. Hello, World! IT'S SHOWTIME TALK TO THE HAND "Hello, World!" YOU HAVE BEEN TERMINATED "9!dlroW ,olleH"ck,@ 72a101a+7aa+3a4... |
Given a grid of directions and a start and end position, determine the minimum number of substitutions in the direction grid that needs to be made to complete the path between the two points. The grid is doubly-cylindrical. This is clearer given an example.
Example
Let's take the following grid as an example:
>>>>v
>>>... |
What is the best BrainFuck code (in terms of code size) to print 'A' 1000 times ?
My approach is:
set 'A' to p[0]
set 255 to p[1] to display 255 'A', 3 times
set 235 to p[1] to display 235 'A'
This is not effective but I cannot find a way to use tow counters simultaneously like a multiplication
Is there a better appr... |
Rules
In this challenge, I'm going to redefine the definition of "quotes" a bit.
Quotation marks (AKA quotes) are any identical characters used in pairs in various writing systems to set off direct speech, a quotation, or a phrase. The pair consists of an opening quotation mark and a closing quotation mark, which is t... |
A traveler needs to stay for n days in a hotel outside town. He is out of cash and his credit card is expired. But he has a gold chain with n links.
The rule in this hotel is that residents should pay their rent every morning. The traveler comes to an agreement with the manager to pay one link of the golden chain for e... |
Challenge:
Given an NxN matrix where \$N\geq2\$ and one of eight distinct 'folding options', output a 2D array/list with the subtracted values.
The eight folding options are: left-to-right; right-to-left; top-to-bottom; bottom-to-top; topleft-to-bottomright; topright-to-bottomleft; bottomleft-to-topright; bottomright-t... |
You are given a string, which will contain ordinary a-z characters. (You can assume this will always be the case in any test, and assume that all letters will be lowercase as well). You must determine how many unique combinations can be made of the individual characters in the string, and print that number.
However... |
Introduction
In a general election, one would like to calculate a constant price per parliament seat. This means that for N >= 0 seats to be distributed and a list ns of votes per party, we would like to find a number d such that
sum(floor(n/d) for n in ns) == N
To make things interesting (and more like the real worl... |
In this challenge you will be determining how controversial a vote is, given an array of other votes, by figuring out a number called the C-factor. What is the C-factor, you ask?
Well, imagine you've got multiple votes on an election. We'll use 1 and 0 for the sake of the challenge to represent two different candidates... |
What is the shortest way to convert a string containing integers separated by spaces to a list of integers?
input : "-3 1 5 8 10"
output : [-3, 1, 5, 8, 10]
I regularly face this situation and I wanted to know if there is a better way than (24 bytes):
list(map(int,s.split()))
|
I was surprised to not find this asked already, though there is a great question on darts checkouts: Darts meets Codegolf
Your challenge is to calculate which scores are not possible with 'n' darts below the maximum score for 'n' darts. E.g. for n=3, the maximum possible score is 180 so you would return [163,166,169,17... |
Introduction
A popular word puzzle is to convert one word into another via a series of steps which replace only one letter and which always result in a valid word. For example, BAG can be converted to DOG via a path of five steps:
BAG -> BAT -> CAT -> COT -> COG -> DOG
Shorter paths also exist in this case; for example... |
Premise:
Your reputation is in Stack-Exchange Form if it can be represented by decomposing your medal counts (gold, silver, and bronze counted separately) into their base-10 digits and joining them in any given order, with a few caveats.
While decomposing, each
Gold medal digit is worth three digits.
Silver is worth... |
I need to construct a functor that iterates over the linear representation of a sub-lattice of size \$d_x,d_y,d_z,d_q\$ embedded in a lattice of size \$n_x,n_y,n_z,n_q\$. The sub-lattice corner is shifted by \$(l_x,l_y,l_z,l_q)\$.
Since the functor can be called million of times, the goal is to produce the most effici... |
The prospect of this challenge is:
If your program is run normally, all of the code in the speech marks (" - double quotes) should be printed.
If your program is wrapped in double quotes (in turn inverting the speech marks), the code that is normally not in quotes should be printed.
E.g:
Let's say you have the follow... |
Introduction
How much of the English alphabet does a given string use? The previous sentence uses 77%. It has 20 unique letters (howmucftenglisapbdvr), and 20/26 ≃ 0.77.
Challenge
For an input string, return the percentage of letters of the English alphabet present in the string.
The answer can be in percentage or in ... |
Assume that there is a number a. In every conversion of that number, the number can either convert itself to its value plus the value of one of its digits, or convert itself to its value minus the value of one of its digits.
In this situation, find the minimum number of conversions one has to make in order to get to th... |
An analog clock has 2 hands*: Hour and minute.
These hands circle the clock's face as time goes by. Each full rotation of the minute hand results in 1/12th of a rotation of the hour hand. 2 full rotations of the hour hand signifies a full day.
As these hands are fixed to the same central point, and rotate around that p... |
Based on a comment by Jo King on my previous question (called 'Inverse-quotes-quine'), I present this new question. The rules are similar, but just, the opposite:
If your program is run normally, all of the code not in the speech marks (" - double quotes) should be printed.
If your program is wrapped in double quotes ... |
This challenge is a sequel to Letter Boxed Validator.
The New York Times has a daily online game called Letter Boxed (the link is behind a paywall; the game is also described here), presented on a square as follows:
You are given 4 groups of 3 letters (each group corresponds to one side on the picture); no letter appe... |
There are 9 main types of numbers, if you categorise them by the properties of their factors. Many numbers fall into at least one of these categories, but a few don't. The categories are as follows:
Prime - no integer divisors other than itself and one
Primitive abundant - A number \$n\$ whose factors (excluding \$n\$... |
The problem:
Given a non-empty set of points in the Cartesian plane, find the smallest circle that encloses them all (Wikipedia link).
This problem is trivial if the number of points is three or less (if there's one point, the circle has a radius of zero; if there are two points, the line segment that joins the points ... |
The purpose of this challenge is to graphically depict a walk on the plane, where the direction of each step \$k\$ is determined by the primality of \$k\$ and the parity of its binary expansion. Specifically,
Initial direction is fixed, say North.
All steps have the same length.
The direction of step \$k\$ can be Nort... |
Write a sorting algorithm for a list of integers that has an average performance of O(n^2).
This is code-golf, so the shortest code in bytes wins.
RULES:
The characters wasted for the declaration of the list are not counted
(e.g. var c = new List<int>() { 4, 2, 1, 3 }; is not counted)
Builtins to sort a list are not ... |
Some numbers, such as \$14241\$, are palindromes in base 10: if you write the digits in reverse order, you get the same number.
Some numbers are the sum of 2 palindromes; for example, \$110=88+22\$, or \$2380=939+1441\$.
For other numbers, 2 palindromes are not enough; for example, 21 cannot be written as the sum of 2 ... |
Given a string x, output the characters in x sorted according to the order of appearance in your source code.
Examples
Source: ThisIs A Test
Input: Is it a Test?
Output: TissI etta?
Source: Harry - yer a wizard.
Input: I'm a what?
Output: aa wh'?Imt
Source: Mr. H. Potter, The Floor, Hut-on-the-Rock, The Sea
In... |
According to Wikipedia, a strongly Darboux function is
one for which the image of every (non-empty) open interval is the whole real line
In other words, a function \$f\$ is strongly Darboux if given 3 arbitrary real numbers \$a\$, \$b\$, and \$y\$, it is always possible to find an \$x\$ between (distinct) \$a\$ and \... |
Here is my ungolfed Ruby code for a function I want to try and golf:
Iter =-> k {
str = ""
(0..k).map{|m| str += "-> f#{m} {"}
str += "f#{k}.times{f1 = f0[f1]};f1"
(2..k).map{|m| str += "[f#{m}]"}
eval(str + "}" * (k+1))
}
The best I can do to golf this is essentially shortening variable names, rem... |
In CSS, colours can be specified by a "hex triplet" - a three byte (six digit) hexadecimal number where each byte represents the red, green, or blue components of the colour. For instance, #FF0000 is completely red, and is equivalent to rgb(255, 0, 0).
Colours can also be represented by the shorthand notation which use... |
Input
A single hex 6-digit colour code, capital letter, without #. Can also be a 24-bit integer if you prefer.
Output
The closest HTML color name (e.g red, or dark-salmon, as defined as https://www.w3schools.com/colors/colors_names.asp or see below). Distance is defined by summing the difference in red, green and blue ... |
Given 2 positive integers in any format you'd like, return their sum using only logic gates and bit shifts (see example below). Don't worry about overflow.
EDIT: Using pre-written addition is obviously not allowed. So no a + b, Add(a, b), a - (-b) etc.
This is code golf, so standard loopholes apply. Shortest program in... |
Introduction:
A few days ago I read this post with the same title when I came across it in the HNQ. It asks if this claim of US presidential candidate Bernie Sanders is true or not:
Today the world's richest 26 billionaires, 26, now own as much wealth as the poorest 3.8 billion people on the planet, half of the world'... |
Introduction
So the Challenge is to give out all combinations with two Inputs. The length of the string is also optional and you should be able to edit this.
I've selected this channel because I thought it would be very easy to do it "normally" but the challenge itself could be very interesting. I had to create that fo... |
Input
A single integer in your language's preferred format, e.g int or an array of digits are all acceptable.
Output
A truthy or falsely value, depending on whether the given number is palindromic (same forwards and backwards)
Rules
Numbers will always be positive, at least two digits long.
This is fastest-algorithm, ... |
I'd like to propose a different kind of golfing challenge to this community:
(Artificial) Neural Networks are very popular machine learning models that can be designed and trained to approximate any given (usually unknown) function. They're often used to solve highly complex problems that we don't know how to solve alg... |
Given two numbers, the first is greater than the second, check whether the first number is divisible by the second without a remainder. If divisible, answer "yes"(or any other string), otherwise "no"(or any other string you like).
Conditions: You cannot use conditional operators, loops, arrays, bitwise operations, func... |
Backstory
Meet my friend Jimmy:
/o\
Jimmy is a little character who likes to stand on platforms. Here's Jimmy safely standing on a platform:
/o\
-------------
Now, Jimmy has a good sense of balance, so he can safely stand with one leg off of the platform, like so:
/o\
-------------------
Although i... |
Create your smallest web server in your preferred language!
Requirements
Must respond to atleast 1 type of request (get,post,patch,delete), with a specified string.
Smallest implementation wins!
*String can be empty
You may use any library you want
My personal record for this was 56B in node
require('express')().use((r... |
This 128-language quine ouroboros (a program which outputs a program in another language, which outputs a program in yet another language, (125 languages later), which outputs the original program) is pretty impressive. But unfortunately, it has a static number of iterations.
Write a program which outputs a program (no... |
Introduction:
Ever used Dropbox with some other people and you both modified the same file? Ever had a multi-user application with a relational database, and two people were modifying (or worse, one was deleting and the other modifying) the same object? Well, let's simulate that with this challenge (sort-of).
For the s... |
Your challenge is very simple: output the previous answer, in reverse.
However, as with this similarly-titled question, there's a catch: in this case, you can only use characters from the answer before the last. For example:
Let's say the first answer looks like this:
1 - Python
print('hi!')
And the second answer loo... |
Your challenge is very simple: output the previous answer, in reverse.
However, as with this similarly-titled question, there's a catch: in this case, you cannot use characters from the answer before the last. For example:
Let's say the first answer looks like this:
1 - Python
print('hi!')
And the second answer looks... |
In this simple but fun challenge, you were asked to determine if Jimmy would fall of their platform. Jimmy has three body parts /, o, and \ arranged like this
/o\
Platforms are represented with -. Jimmy will fall off their platform iff they have two or more body parts that are not directly above a platform.
Some exa... |
I honestly can't believe this challenge does not already exist.
The challenge
Write a function.
The specifics
Your program must define some sort of callable function. This includes anything commonly known as a function, a lambda function, or a subroutine. All of these types of callables will be referred to as a "funct... |
In a matrix of characters, a cursor is a movable position between two adjacent characters, before the first character or after the last character in a line, like that "I"-shaped indicator which moves while you type.
In this challenge, a cursor position is considered valid if at least one of its two sides touches a spac... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.