All Questions

Filter by
Sorted by
Tagged with
2
votes
0answers
33 views

Branch Out - Monkey Edition

The Monkey has swung home to find his tree all in pieces. He likes order and scoops up all his 'tree-parts' and sets them out in 3 groups. The Monkey's ...
11
votes
12answers
292 views

Square-Cube Digit Usage

The point of this challenge is to find the smallest positive integer that uses up at least all of the digits supplied in the input after it is squared and cubed. So, when provided an input such as <...
6
votes
6answers
217 views

Pairs of palindromic anagramic dates separated by a palindromic number of days

Definitions: A palindrome is a string which reads the same backward or forward (not counting spaces or special characters), such as "madam" or "Sorel Eros". A date is said to be a palindrome when ...
3
votes
5answers
161 views

String-wise calculus (i)

This will turn into a series involving other aspects of calculus, including using the "derivative" of a string to find "stationary points" etc, as well as "integration" of sentences Introduction If ...
16
votes
7answers
783 views

Single Digit Representations of Natural Numbers

Task Write a program/function that when given a positive integer \$n\$ and a digit \$d\$ which is not 0 outputs a way to represent \$n\$ using only addition, subtraction, multiplication, ...
1
vote
1answer
96 views

Polyglot “Hello world” in Fortran and Lisp [duplicate]

Simple challenge: The code must be both valid Lisp and valid Fortran, and must print out "hello world" in both. Note: I've sunk about 5 hours into this at this point, I'm not even sure it's possible ...
12
votes
21answers
1k views

Summing a sub-square of a quarter of an infinite chessboard

Description of the problem Imagine a quarter of an infinite chessboard, as in a square grid, extending up and right, so that you can see the lower left corner. Place a 0 in there. Now for every other ...
20
votes
8answers
755 views

Counting Distinct Real Roots of Low-Degree Polynomials

Challenge: I want to know about the real roots of polynomials. As a pure mathematician, I care about the existence of such roots, rather than their numeric values. The challenge is to write the ...
13
votes
0answers
211 views
+250

Impress Donald Knuth by counting polyominoes on the hyperbolic plane

This challenge is inspired by a talk about Schläfli symbols, etc that I gave in a Geometry seminar. While I was putting together this challenge, I saw that Donald Knuth himself was interested in (some ...
-15
votes
1answer
161 views

What's the shortest way to round up to the next integer in python? [closed]

What's the fastest way given a mathematical expression or value to always round up to the next integer if the result from the expression is not an integer. e.g. 5.0001 -> 6 66.4 -> 67 99....
25
votes
38answers
4k views

Is it really time?

A time in the format hhMMss is represented by six numbers in the range 0..9 (e.g.100203 for 3 seconds after 2 minutes after 10am (10:02.03), or ...
9
votes
5answers
459 views

Computing a specific coefficient in a quotient of polynomials

Context After "Computing a specific coefficient in a product of polynomials", asking you to compute a specific coefficient of polynomial multiplication, I wish to create a "mirror" challenge, asking ...
-7
votes
0answers
55 views

A Problem on Hackerrank [closed]

I have a problem on Hackerrank: link:https://www.hackerrank.com/contests/101hack34/challenges/beautiful-string P/S: No limit on input size, no strings, arrays or non-basic data structures I don't ...
33
votes
43answers
2k views
+50

(RGS 1/5) Binary multiples

(Note: the bounty should read 4 days and not 4 hours!) A binary multiple of a positive integer k is a positive integer n such ...
13
votes
15answers
1k views

Is this a circular step sequence?

Background We define a circular step sequence of order \$n\$ as follows: $$ a_1, a_2, \dots, a_n = \text{Permutation of } 1 \dots n \\ b_i = \min ( |a_{i+1} - a_i|, n-|a_{i+1} - a_i| ), 1 \le i < ...
7
votes
18answers
740 views

Put in the quotes

Background There's a terrible problem in my console - the quotes never get included inside the arguments! So, when given this argument: ["abc","def","ghi","jkl"] ...
-3
votes
1answer
32 views

When relating to code golf do I call it “simplifying my code” or “optimizing my code” or something else [closed]

Like if I have this: x=5 y=2 and I do this x,y=5,2 Do I call this simplifying or optimizing or something else? What is the terminology here.
1
vote
0answers
38 views

Bracket Checker [duplicate]

Given a string of brackets tell the user whether or not the brackets are well matched or not. Brackets include []{}(). For example: ...
0
votes
4answers
459 views

Broken Keyboard

You're writing your favorite language and you want to display the following string: abcdefghijklmnopqrstuvwxyz to your happy customer. Unfortunately, your keyboard ...
25
votes
14answers
2k views

Toggle Shift Key

Objective Given an ASCII character, toggle its "shift-ness" on the standard US keyboard (ANSI-INCITS 154-1988 (R1999)), then output it. Mapping ...
4
votes
12answers
362 views

Creating words by structure

Context As a conlanger, I am interested in creating a uniform, naturalistic language. One of the tricks is to create vocabulary according to certain structures of words. An example from English: In ...
12
votes
14answers
2k views

Simulate a random walk

Context In this challenge, a random walk is a stochastic process in which a particle at a position with integer coordinates (or a drunk man) moves at each integer time step (that is, at ...
-1
votes
0answers
68 views

Counting the roots of Polynomials [duplicate]

The challenge is to write the shortest program/function which counts the number of distinct real roots of a given polynomial. Expected input: a list of integers, L, which are the coefficeints of ...
-6
votes
10answers
173 views

Generate a secure password [closed]

Task Your task is to generate a password that is both secure and short in the fewest bytes possible given an integer seed as input. Input No seed Or An integer seed Output A password Scoring ...
22
votes
23answers
2k views

Find self-locating strings in a number

Based on this Numberphile video A self-locating string is a number (or set of numbers) in a decimal expansion which corresponds to its location, from the start of the decimal. For example, take the ...
2
votes
2answers
180 views

First forkbomb in dart lang [closed]

Let‘s golf it to the max! So I wondered why there is no forkbomb on the web for dart... so I created one. I started to golf it to: Dart, 98 bytes ...
22
votes
16answers
4k views

ASCII art is ready for take-off

Task Given a positive integer n, draw the corresponding rocket. Examples From n = 1 to 4 ...
15
votes
5answers
784 views

How many unique one sided polyominos

Context From Wikipedia: A polyomino is a plane geometric figure formed by joining one or more equal squares edge to edge. one-sided polyominoes are distinct when none is a translation or rotation of ...
38
votes
13answers
3k views

Phony fractions

Context If a0 and b0 are two decimal numbers, with a and ...
14
votes
10answers
2k views

Visualize a Recursive Acronym

Background Famously, the acronym GNU stands for GNU's Not Unix. 1 It's recursive because, after expanding it once, it still ...
-7
votes
0answers
118 views

Math Question - Grade 6 [duplicate]

Mr.Hś odometer shows a mileage of 126251 kilometers. In how many kilometers will the odometer show a palindrome number
23
votes
21answers
3k views

The most common substring

The purpose of this task is to write a program or function to find the most common substring within a given string, of the specified length. Inputs A string, s, ...
2
votes
5answers
156 views

Shift the digits [closed]

Here, x (supplied as input) and n (the result of your computation) are both positive integers. n * x = n shifted. Find n. Here's an example of shifting: ...
0
votes
0answers
53 views

code-bowlingn't [duplicate]

If you place the suffix n't on any given word, it instantly means the opposite of the intended usage of the word. If you place the word ...
51
votes
21answers
6k views

The Sorting Hat

Context At Hogwarts School of Witchcraft and Wizardry, students are sorted into 4 houses, Gryffindor, Ravenclaw, ...
15
votes
4answers
620 views

Game of Game of Life

Game of Game of Life Conway's Game of Life is a 0-player game. But that's okay! We can make it a multi-player game. This game is played on the smallest square grid that will accommodate a 6x6 ...
7
votes
0answers
322 views

Finding Radical Ideals

Sandbox Finding radicals of arbitrary ideals in rings is hard! However, it's a doable task in polynomial rings, since they are Noetherian (all ideals are finitely generated) Background A quick ...
25
votes
20answers
4k views
+100

Egg, sausage, bacon and spam (lovely spam!)

You are given four integers: \$e,s,b\in\{0,1\}\$ and \$S\in \{0,1,2,4\}\$, where \$e,s,b,S\$ stand for egg, sausage, bacon and spam respectively. Your task is to figure out whether the corresponding ...
3
votes
7answers
197 views

String permutations

Print the biggest-size subset of strings in the input that are all permutations of each other. If there are ties, any one will do. If no strings are permutations of each other (for example, only one ...
23
votes
6answers
6k views

ASCII Pizza (no pineapple)

I like pizza! Task Given the radius of a pizza and a list of ingredients, create the corresponding ascii pizza! Example size 4 pizza with mozzarella cheese, olives and ham: ...
8
votes
2answers
357 views

Find the largest recurring prime

Inspired by Find the largest fragile prime A recurring prime (or whatever you choose to call it) is a prime that, when removing leading digits, always remain prime regardless of how many digits are ...
10
votes
22answers
987 views

Sort list by types

Rules You will receive as input a list that contains integers and strings. Your task is to move all of the strings to the end of the list and all of the integers to the beginning of the list. This ...
1
vote
2answers
428 views

Hash bomb filtrate

Pipe a short stream to the following Java program run with accompanying command line options, such that it prints true. ...
15
votes
26answers
2k views

Drawing one-liner

CodeDrawing one-liner Teaser Behold this formidable drawing: Can you draw this in a single stroke? Give it a try. Can you do this one, now: Give it a try. How it works These "make this drawing ...
31
votes
15answers
6k views

Fastest yes in the west

There has been a question about yes in the past, but this one is slightly different. You see, despite yes having a rather long size, it is incredibly fast. Running ...
21
votes
17answers
2k views

Answer templating

Context Just look around! Whenever someone posts an answer, the same template is followed over and over again! A first line with the byte count and language name. Then the code. Then the TIO link. ...
12
votes
9answers
1k views

Integer Logarithm

Objective Take \$a \in ℤ_{>1}\$ and \$b \in ℤ_+\$ as inputs. Write a function \$f\$ such that: $$ f(a,b) = \left\{ \begin{array}{ll} \log_ab & \quad \text{if} \space \log_ab \in ℚ ...
20
votes
2answers
588 views

Are They Similar Polygons?

Task Given the x,y coordinates (coordinates are guaranteed to be integers) of the vertices of two simple polygons in clockwise or anti-clockwise order. Output a Truthy value if both the polygons are ...
2
votes
0answers
101 views

Predictor Generator [closed]

Write a program that when given a string \$S\$, it generates a program of the same language as itself. The generated program, when given a continuous substring of \$S\$, should predict the next ...
6
votes
4answers
491 views

Count regex matches

Your task Given a simple regular expression, you have to count how many strings of length n have a match of length n with the ...

15 30 50 per page
1 2 3 4 5 226