For challenges which involve deciding whether or not the input meets certain criteria, and outputting a Boolean value representing that decision.

learn more… | top users | synonyms

14
votes
18answers
2k views

Is this a Hardy-Ramanujan-Number-ish Harshad Number?

Background The number 1729 is the Hardy-Ramanujan number. An amazing property of it was discovered by S. Ramanujan (who is widely regarded as the greatest Indian mathematician1), when G.H. Hardy paid ...
7
votes
5answers
298 views

Surrounded and reversed

The task In this challenge, your task is to determine whether some string occurs as a substring of a given string both surrounded by another string and reversed. Your input is a non-empty string S ...
39
votes
45answers
9k views

Is my OS 32-bit or 64-bit?

So, with all the challenges out, I'm surprised this one isn't here yet. It's not too important anymore, but occasionally somebody needs to know. Here is a simple golf: Taking no user input, tell me ...
22
votes
22answers
3k views

Am I a Cullen Number?

A Cullen Number is any number that is contained in the sequence generated using the formula: C(n) = (n*2^n)+1. Your Task: Write a program or function that receives an input and outputs a truthy/...
10
votes
11answers
911 views

Am I a Special N-bonacci Number?

The N-bonacci sequence, originally invented by @DJMcMayhem in this question, is a sequence generated by starting with the integers 0 and 1, and then adding the previous N numbers to generate the next ...
0
votes
0answers
46 views

Natural Numbers Interpretation [closed]

When interacting with an automated dialogue system, the caller is often required to provide his phone number. Phone numbers may be uttered in many ways with different digit groupings (e.g. 2106930664 ...
31
votes
48answers
7k views

Am I a Fibonacci Number?

Your Task: Write a program or function to check if a number that is inputted is a Fibonacci number. A Fibonacci number is a number contained in the Fibonacci sequence. The Fibonacci Sequence is ...
13
votes
10answers
2k views

Am I a Secondary Taxicab?

Background Ramanujan's number, 1729, is called a taxi-cab number due to the (possibly apocryphal) tale of Hardy boarding a cab to visit Ramanujan in hospital having this number, which seemed bland to ...
4
votes
0answers
90 views

Arranging arbitrary shapes to fill a rectangular space

A while ago, I posted a challenge asking to determine whether or not it's possible to arrange arbitrary rectangles to fill a rectangular space, here. That got answers, so clearly it was too easy. (...
20
votes
18answers
1k views

Does it repeat?

A string of characters repeats if it contains two consecutive substrings that are equivalent. For example, 2034384538452 repeats as it contains 3845 twice, consecutively. Therefore, your challenge ...
7
votes
1answer
280 views

Regex that matches everything but itself

You must make a regex that matches everything except itself. For example, PPCG must not match PPCG, but must match everything else, like something, PPC, and PPCG!. Surrounding slashes are not ...
27
votes
45answers
5k views

It's Hip to be Square

Challenge So, um, it seems that, while we have plenty of challenges that work with square numbers or numbers of other shapes, we don't have one that simply asks: Given an integer n (where n>=0) ...
25
votes
53answers
2k views

Is this number a repdigit?

Challenge A repdigit is a non-negative integer whose digits are all equal. Create a function or complete program that takes a single integer as input and outputs a truthy value if the input number ...
2
votes
0answers
100 views

Can those squares form an imperfect square [duplicate]

Given a non-empty array of positive integers, determine if it is possible to take squares with side lengths specified by each integer, and arrange them in space such that they form a square. The ...
42
votes
40answers
6k views

Is this string a square?

A string is considered to be square if the following conditions are met: Each line has the same number of characters The number of characters on each line is equal to the number of lines. Your task ...
11
votes
7answers
622 views

Do two numbers contain unique factorials?

Break two numbers up into their factorials; if they share any, return a falsey value. Otherwise, return a truthy value. (inspired by this recent question) In other words, write each input number as ...
7
votes
28answers
2k views

Do two numbers contain unique powers of 2

Break two numbers up into their powers of 2, if they share any, return a falsey value. Otherwise, return a truthy value. If one input is 0, the answer will always be truthy. if one input is 255, the ...
4
votes
0answers
36 views

Can my favourite team still become Football Champion?

As a fan of an at most moderately successful footballBE team, towards the end of the season I often wonder whether my favourite team still has any theoretical chance left of becoming champion. Your ...
3
votes
18answers
467 views

Is there an unmatched parenthesis in this String?

Introduction Given a String containing an arithmetic expression, your task is to output a truthy or falsey value based on whether it contains unmatched parentheses. Input Your program should take ...
4
votes
4answers
211 views

Let's get the gang back together! [closed]

A narcissist program is a program that only accepts its own source code. A bigotous program is a program that only accepts the source code of programs semantically equivalent to itself. A gang member ...
8
votes
5answers
4k views

Is it Covfefey?

Based on this challenge, you must determine if a string is covfefey, that is, could it have been produced as output from a covfefifier? The string will be composed of only alphabet chars (^[a-z]\*$, ^...
-22
votes
35answers
305 views

Test if two numbers are equal

Challenge Input two decimal integers. If the integers are equal, output a truthy value. Otherwise, output a falsy value. Clarifications You will never receive non-integer inputs. You will never ...
-11
votes
8answers
175 views

Is it true or false? [closed]

I cannot believe that this hasn't been done before but I may be wrong. If so, just close as dupe. This challenge is very similar to Is it truthy or falsy? but, IMO, isn't close enough to be a dupe. ...
10
votes
14answers
445 views

Validate 2Col syntax!

As a couple of people may have noticed lately, I've largely abandoned development of Braingolf because it's boring and uninspired, and moved on to 2Col which is a little more interesting, and not ...
62
votes
47answers
13k views

Is this relationship creepy?

According to this XKCD comic, there is a formula to determine whether or not the age gap in a relationship is "creepy". This formula is defined as: (Age/2) + 7 being the minimum age of people you ...
6
votes
7answers
751 views

Is the graph acyclic?

A Directed Acyclic Graph (DAG) is a type of graph that has no cycles in it. In other words, if there is a link from node A to node B, there exists no path from B to A (via any nodes). Challenge ...
19
votes
42answers
3k views

Is this number triangular?

Challenge Given a positive integer, determine whether it is a triangular number, and accordingly output one of any two constant, distinct values. Definition A triangular number is a number that can ...
5
votes
0answers
225 views

Don't break the bridges!

Introduction: You are a worker, who is in charge of managing a set of bridges, connecting a square grid of "nodes": N - N - N | | | N - N - N | | | N - N - N (the grid here is 3 by 3, but ...
28
votes
51answers
4k views

Is this number a factorial?

The Task Given a natural number as input, your task is to output a truthy or falsey value based on whether the input is a factorial of any natural number. You can assume that the input number will ...
12
votes
3answers
280 views

Was this bite mine?

Yesterday, I left my sandwich on the table. When I got up today, there was a bite in it... Was it mine? I can't remember... Problem: Take a representation of the sandwich and my bite pattern and ...
7
votes
1answer
285 views

(Can I) Add parentheses to make this true

I saw this recent Puzzling question: Add parentheses to make this true And saw that one answer used a Python script to try all possibilities. Your challenge is, given an expression (as a string) ...
10
votes
15answers
1k views

Check if a matrix is a Toeplitz matrix

You will be given a two-dimensional array and a number and you are asked to find whether the given matrix is Toeplitz or not. Input Format: You will be given a function which will take two-...
27
votes
25answers
712 views

Does the sum of 2 numbers in the list equal the desired sum? [duplicate]

The Task This is my first challenge so apologies if it is very simple! In this challenge, your task is to write a program or function which takes in a list of integers and a desired sum and outputs ...
15
votes
1answer
447 views

Is it a Cactus?

In graph theory, a Cactus is a connected graph such that any distinct two simple cycles in the graph share at most one vertex. Here is a Cactus with 3 simple cycles outlined with dashed lines. The ...
34
votes
69answers
4k views

Does the start equal the end?

The Task In this challenge, your task is to write a program or function which takes in a String and outputs a truthy or falsey value based on whether the first character and the last character of the ...
17
votes
36answers
2k views

Determine if an Array contains something other than 2

Take an array which consists of numbers or arrays, output if it only contains 2s. Output should be a truthy or falsey value (Sorry if this destroys answers) Truthy Test Cases [2] [2,2] [[2],[2,2],2]...
13
votes
2answers
465 views

Am I outgolfed by Dennis?

According to legend, almost everyone is outgolfed by Dennis. If not, they will be. Now I'm curious if I'm one of those 'almost everyone'. You will be given a link to an answer in the format of https:...
13
votes
1answer
235 views

Is magic possible?

A magic square is an n-by-n square grid, filled with distinct positive integers in the range 1,2,...n^2, such that each cell contains a different integer and the sum of the integers in each row, ...
39
votes
37answers
4k views

Is this a function?

Given a list of (key, value) pairs, determine whether it represents a function, meaning that each key maps to a consistent value. In other words, whenever two entries have equal keys, they must also ...
13
votes
18answers
4k views

When will SE be down?

SE will be down/read only today 2017-05-04 at 00:00 UTC until 00:20 UTC. Your challenge is to output a truthy value if SE is down/read only and a falsy value if SE is not. You may not have any input, ...
2
votes
0answers
217 views

Is it a bird, is it a plane? [closed]

Challenge Supplied an image, you must determine if the subject of the image is a bird or a plane. If the image is a bird, your program must output bird and if the image is a plane, your program ...
15
votes
8answers
318 views

Reachable numbers

Definitions Euler Phi Function (AKA totient function): a function which takes in a positive number and returns the number of positive numbers less than the given number which are co-prime with given ...
23
votes
20answers
1k views

Test if a string can be made with substrings!

Given a string s and an array/list l, determine whether or not s can be made with parts from l. For example, if the string is "Hello, world!" and the list is [' world!', 'Hello,'], then the program/...
20
votes
10answers
907 views

Reverse and add degeneracy

Intro Reverse and add is as simple as it sounds, take n and add it to its digits in reverse order. (e.g. 234 + 432 = 666). If you apply this process repeatedly some numbers will eventually hit a ...
15
votes
8answers
1k views

Connect Four Validator

Introduction Connect Four is a game where you attempt to get four in a row: horizontally, vertically, or diagonally. In this code golf, we will be trying to find who won, given a game board. There ...
17
votes
2answers
491 views

Are these lists equal?

As you may very well know python has lists. As you might not know these lists can contain themselves. a = [] a.append(a) Python 2 Python 3 These are cool and there are lots of interesting things ...
19
votes
6answers
706 views

Lossy or Lossless?

Given an audio file, determine whether it is encoded in a lossy format or a lossless format. For the purposes of this challenge, only the following formats need to be classified: Lossy AC3 AMR AAC ...
25
votes
11answers
4k views

Is this number an exact power of -2: (Very) Hard Mode

This is a version of the recent challenge Is this number an integer power of -2? with a different set of criteria designed to highlight the interesting nature of the problem and make the challenge ...
37
votes
37answers
6k views

Is this number an integer power of -2?

There are clever ways of determining whether a number is a power of 2. That's no longer an interesting problem, so let's determine whether a given integer is an integer power of -2. For example: -2 ...
10
votes
2answers
454 views

Two roads diverged in a yellow wood (part 3)

Note: This is based on Two roads diverged in a yellow wood (part 2), a previous challenge of mine. Because of the popularity of that question and Two roads diverged in a yellow wood (part 1), I wanted ...