Linked Questions

44
votes
57answers
4k views

Is this word Lexically Ordered?

Given an input string S, return truthy if all the letters in S are Lexically Ordered: their ASCII values need to be in either ascending or descending order. Return <...
52
votes
39answers
6k views

The forbidden built-in

In the standard loopholes, the following is forbidden: Claiming that your answer is written in "MyOwnLanguage", where the command x means "read a sequence of ...
34
votes
34answers
7k views

Flatten the Array!

In this challenge, your task is to create a program which takes in a nested array and returns a single-dimensional flattened array. For Example [10,20,[30,[40]],50] ...
44
votes
37answers
3k views

Increment an Array

Given a nonempty array of positive integers, "increment" it once as follows: If all the array elements are equal, append a 1 to the end of the array. For example: ...
46
votes
27answers
2k views

Divisor skyline

For any positive integer k, let d(k) denote the number of divisors of k. For example, ...
37
votes
32answers
2k views

String subtraction

Objective Create a function to reverse string concatenation Input Two strings (alphanumeric + spaces), where one should be subtracted for the other. You can assume that the string to be ...
33
votes
31answers
3k views

Let's decrease the monotony

...but hey, no need to be strict. Given a non-empty array of strictly positive integers, determine if it is: Monotone strictly decreasing. This means that each entry is strictly less than the ...
44
votes
19answers
7k views

Theoretically output Graham's number

Graham's number G is defined in this way: ...
44
votes
22answers
8k views

The prime frog 🐸

The "prime frog" is a strange animal that jumps between integers, until it arrives on 3 or 19... Your program should accept an integer n as input and output the ...
29
votes
24answers
4k views

How Many Rectangles in the Grid?

Well, although this challenge turned out to be a huge success, it also turned out to be very trivial to solve. Therefore, for those of looking for more of a challenge, I created a sequel to this ...
30
votes
29answers
3k views

Hate/love conundrum

Challenge description In this challenge, we only consider love and hate as feelings. If we want to utter a feeling expression ...
30
votes
28answers
2k views

Decompose binary into alternating subsequences

This was inspired by Problem 13 - Non-Repeating Binary of HP CodeWars' recent competition. Let's take a random decimal number, say 727429805944311 and look at ...
26
votes
22answers
6k views

Is it a good 2048 board?

This is my first question here, so any suggestions in the comments would be appreciated! Thanks ;) Introduction One very common strategy for the 2048 game is never ever swiping down. This positions ...
17
votes
39answers
1k views

Sum \$\text{Square}^2\$

Let \$n=42\$ (Input) Then divisors are : 1, 2, 3, 6, 7, 14, 21, 42 Squaring each divisor : 1, 4, 9, 36, 49, 196, 441, 1764 Taking sum (adding) : 2500 Since \$50\times 50=2500\$ therefore we return ...
15
votes
35answers
3k views

Hofstadter H-sequence

Definition a(0) = 0 a(n) = n-a(a(a(n-1))) for integer n > 0 Task Given non-negative ...

15 30 50 per page