instruction_seed stringlengths 29 40.5k | source stringclasses 6
values |
|---|---|
Introduction
Most of you are familiar with the merge sort algorithm for sorting a list of numbers. As part of the algorithm, one writes a helper function called merge that combines two sorted lists into one sorted list. In Python-like pseudocode, the function usually looks something like this:
```
function merge(A,... | evolcodegolf |
The challenge
Given a positive integer N, compute the proportion of N-step walks on a plane that don't intersect themselves. Each step can have any of the 4 possible directions: North, East, South, or West. A walk intersects itself if it visits a previously visited point. Additionally, ensure that the output is consist... | evolcodegolf |
I consider myself an occasional participant in code golf challenges and tend to discover questions primarily when they appear within the "Hot Network Questions" section on StackOverflow. Often, I find myself joining the discussion after most contributions have already been made, and given that my expertise lies solely ... | evolcodegolf |
Input
None
Output
52 unique cards are to be represented utilizing their specific unicode characters, formatted in the following manner:
The initial three digits shall consistently be 1F0.
The subsequent digit must be one of A, B, C, or D, corresponding to spades, hearts, diamonds, and clubs respectively.
T... | evolcodegolf |
Task
Formulate a concise regex as a non-empty regular expression encompassing exclusively
characters denoting binary digits 0 and 1,
grouping symbols ( and ),
a quantifier for one-or-more repetitions +.
Given a non-empty sequence comprising solely of 0s and 1s, your program should identify the most compact si... | evolcodegolf |
A complex register calculator with additional constraints
This challenge requires the creation of a sophisticated register calculator that operates in the following manner:
It features a set of registers named A, B, C,..., Z, each capable of storing an integer and initialized to 0. The calculator executes instructio... | evolcodegolf |
Given a string composed of unsorted alphanumeric characters, for instance,
ABC321STPpJqZZr0,
produce a meticulously structured ", "-separated list of character ranges, arranged in ascending ASCII order, while disregarding case sensitivity and eliminating any duplicates (specifically including only uppercase letters... | evolcodegolf |
Given an integer n, determine the subsequent number that adheres to the following criteria:
The next greater number must be such that each digit, from the most significant to the least significant, is either greater than or equal to its predecessor. To illustrate, consider the example 1455:
1 < 4
4 < 5
5 <= 5
Further... | evolcodegolf |
My dog is called Rex. Every time I scold him, he seems not very impressed and the only times I see him react is when I pronounce his name. If I say
Rex, I told you not to do this! You're making me angry Rex!
all he hears is
Rex, * **** *** *** ** ** ****! ***'** ****** ** ***** Rex!
The challenge: given an input stri... | evolcodegolf |
Objective:
The task involves the intricate development of a sophisticated chatbot that facilitates profound dialogues, enabling users to explore and articulate their most profound thoughts and emotions. This chatbot must integrate an advanced AI learning framework that adapts and evolves based on user interactions, ul... | evolcodegolf |
A truncated square-pyramid of height \$h\$ comprises \$h\$ distinct square layers, each characterized by a side length that is \$1\$ unit larger than the layer situated directly above it, with the exception of the apex layer, which is defined by a predetermined square of blocks exhibiting a specified side length. Below... | evolcodegolf |
A sequence known as an addition-subtraction chain is represented as \$a_1, a_2, a_3, ... ,a_n\$, where \$a_1=1\$ and for every \$i > 1\$, there exist indices \$j,k<i\$ such that \$a_i = a_j \pm a_k\$. Your objective is to determine the most concise addition-subtraction chain for a specified integer \$x\$, ensuring that... | evolcodegolf |
Introduction
You can skip this part if you already possess a solid understanding of the concept of a cyclic group. A group is formally defined by a set paired with an associative binary operation \$\times\$ (specifically, it adheres to the property that \$(a \times b) \times c = a \times (b \times c)\$). There exists... | evolcodegolf |
In a distant universe, children engage in a mystical duel known as The Elemental Showdown.
Rules:
Two participants (referred to as X and Y) harness the powers of nature. Each player has three elemental moves:
1. **Gather Energy**: By raising their hands, players accumulate energy from the environment. Each turn inc... | evolcodegolf |
You've been given a Hexagonal Grid represented as follows:
grid = [
[''],
['',''],
['','',''],
['','','','','',''],
['','','','',''],
['','','','','',''],
['','','','',''],
['','',''],
['',''],
['']
];
Your task is to take two inputs x and y (referring to grid[x][y]) and return the coo... | evolcodegolf |
While some individuals might have a basic understanding of the mechanics behind motorcycle gear shifting, there are others who might not be acquainted with the process at all. Typically, the gear sequence is represented as follows:
```
6
5
4
3
2
N
1
```
I would appreciate it if you could calculate my current gear sta... | evolcodegolf |
The Euclidean GCD Algorithm is a methodical computational procedure that efficiently determines the greatest common divisor (GCD) of two positive integers through a systematic process of repeatedly subtracting the lesser of the two integers from the greater until both converge to the same value. This algorithm can be c... | evolcodegolf |
Introduction
Let us meticulously examine the following sequence of characters:
AABBCCDDEFFGG
In this string, each letter appears in pairs, with the notable exception of the letter E, which stands as a single occurrence. This indicates that the letter E has undergone a process of de-duplication. Thus, our objecti... | evolcodegolf |
After successfully navigating the chaotic realm of the 4-8-8 tiling, you stumble upon a peculiar phenomenon—a parallel dimension featuring an infinite dodecagonal grid. As you gather your bearings, a frantic binary entity appears, shouting for assistance: "My child process is lost among the 12-sided tiles! Please, can ... | evolcodegolf |
This task challenges you to generate an exhaustive list of all conceivable words that can be constructed from a specified arrangement of syllables. These words are formulated by seamlessly concatenating individual syllables, each of which consists of a sequence of vowels that may optionally include a certain number of ... | evolcodegolf |
Task
Given a finite permutation represented as a list of unique natural numbers, output the permutation that swaps each adjacent pair of elements. You may take input and output in any reasonable format that maintains the list structure. You can choose to index the list starting from 0 or 1, but be consistent througho... | evolcodegolf |
Background
You have once again been assigned the intricate task of determining the quantity of landmines concealed within a specified field. However, this time, you are deprived of a concrete landmine count, and certain landmines have already detonated. Your challenge is to ascertain the landmine score based on a pro... | evolcodegolf |
Given a number k (1 <= k <= 100000), determine if k and the sum of its digits squared yield the same set of digits, and output a truthy or falsey value based on that comparison. For instance, let's examine the number 23. The sum of the digits of 23 is 2 + 3 = 5, and squaring this gives us 25. The set of digits in 23 is... | evolcodegolf |
For each specified nonnegative integer \$n\$, it is feasible to devise at least one integral polynomial \$p \in \mathbb Z[X]\$ such that the evaluation \$p(k)\$ provides the coefficient of the term \$x^k\$ within the polynomial for every integer \$0 \leqslant k \leqslant n\$. To ensure uniqueness, we stipulate that the... | evolcodegolf |
Consider a sequence defined by the recurrence relations, f(n) = f(n-1) + f(n-2), where the starting values are f(1) = x1 and f(2) = x2. For instance, if x1 = 2 and x2 = 1, the generated sequence unfolds as follows:
2 1 3 4 7 11 18 29 47 76 123 199 322 521 843
When concatenated into a single string, it r... | evolcodegolf |
Synopsis
Your objective is to implement the (asymptotically) fastest growing function within bounded code on a fictional CPU utilizing a quite limited, yet (probably) turing-complete instruction set while ensuring that your program adheres to a strict memory layout that allows for enhanced readability and maintainabi... | evolcodegolf |
DONT EVALUATE YET, ALMOST FINISHED, NEED A CLEAR WINNING CRITERION
Help me amass substantial wealth in the expansive world of Minecraft.
Minecraft is an intricate 3D sandbox game constructed from destructible and placeable blocks, which allows for the creative construction of various farms yielding essential game resou... | evolcodegolf |
Note: This is #2 in a series of array challenges. For the previous challenge, click here.
Separating Nested Lists
To separate values in a nested list, flatten it, and then wrap each value so it is at the same nested depth as before while ensuring that each non-empty sublist maintains its original order of elements... | evolcodegolf |
In this task, you are required to design and implement a function that effectively converts Greek numerals, which are expressed as strings, into their corresponding Arabic numeral values. The input provided will consist of a Greek numeral that must fall within the range of more than 0 and less than 1000. This challenge... | evolcodegolf |
Input
Two non-negative floating point numbers \$x < y\$. You can assume they are close enough to each other that there is no integer between \$x\$ and \$y\$. Furthermore, the output fraction must also be in its simplest form with a denominator not exceeding 100.
Output
A fraction with the smallest possible denomi... | evolcodegolf |
This challenge presents a sophisticated task inspired by the Recover the mutated source code problem, demanding a more intricate approach. You are tasked with developing two programs or functions in the same programming language, each fulfilling a distinct requirement. The first program must effectively compute the Col... | evolcodegolf |
Designing a flexible integer printing utility is indeed intriguing; however, developing a single program capable of generating a range of diverse integers can become rather tedious. Wouldn't it be more efficient to craft a script that not only outputs a specified integer but also provides you with a subsequent script t... | evolcodegolf |
In what ways can I condense the following code snippet while ensuring the input sequence adheres to the format of receiving an integer, followed by a string, and concluding with another integer?
p=gets.to_i
a=gets
b=gets.to_i | evolcodegolf |
CHALLENGE STATUS: OPEN
Comment, initiate a PR, or otherwise voice your concerns directly at me if you feel your bot is not being adequately represented.
Engaging in a variant of the prisoner's dilemma that includes three distinct choices—quite intriguing, right?
Here’s the accompanying payoff matrix, where Player ... | evolcodegolf |
In this question, we explore the concept of a "nested" function, which is defined as a function that:
is a bijection, meaning every element in the domain corresponds to a unique element in the codomain and vice versa.
and enables any element to be derived from another through a series of applications of the function o... | evolcodegolf |
One of my preferred mathematical explorations involves constructing a meticulously defined rectangular grid and subsequently identifying every distinct rectangle that remains perceptible within that grid. Here, delve into this intriguing inquiry and seek the answer yourself! Can you tally the total number of rectangles... | evolcodegolf |
Good Afternoon, Esteemed Golfgeneers.
This inquiry is relatively extensive and meticulously detailed, necessitated by the complexity of the subject matter. Should any uncertainties arise, please do not hesitate to pose your queries. Additionally, if there are any ambiguities that require clarification, inform me so I... | evolcodegolf |
Your task is to produce this precise pattern:
az za
abyz zyba
abcxyz zyxcba
abcdwxyz zyxwdcba
abcdevwxyz ... | evolcodegolf |
In this challenge, you are presented with a string, for example, "Hello World!", which you are required to analyze by first transforming it into its corresponding character values: 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 33. Subsequently, engage in a detailed examination by computing the differences between... | evolcodegolf |
This particular challenge draws inspiration from the concept presented in Yeah But No But Yeah.
Recently, a colleague of maxb presented him with the following JavaScript code as a humorous jest:
let butScript = (nrOfButs) => {
for(var i = 0; i < nrOfButs; i++){
if(i % 3 == 0){
console.log("Yeah... | evolcodegolf |
It seems that the moment has arrived for us to engage in another intriguing proof-golf challenge, focusing this time on validating the well-established logical statement \$(A \rightarrow B) \rightarrow (\neg B \rightarrow \neg A)\$. To achieve this, we will leverage Łukasiewicz's third Axiom Schema, which comprises an ... | evolcodegolf |
Individuals acquainted with the engaging content of Numberphile will undoubtedly recognize the expertise of Dr. James Grime, who elucidated a fascinating non-transitive dice game on his channel. This intricate game features three distinct 6-faced dice:
Die 1: 3,3,3,3,3,6
Die 2: 2,2,2,5,5,5
Die 3: 1,4,4,4,4,4
In... | evolcodegolf |
Symja functions as a specialized computer algebra language and a Java symbolic math library designed for use within the Android NCalc calculator. Given its unique characteristics, I am curious if anyone can provide insightful tips or advanced techniques for optimizing code length when golfing in Symja. Please note that... | evolcodegolf |
Imagine a scenario where I am positioned ten steps away from my intended destination. My approach to reach it is guided by the traditional notion of "taking two steps forward and one step back". As I proceed with this rhythm of movement—taking two steps forward and then retreating one step back—my goal is to arrive pre... | evolcodegolf |
A conventional set of double-six dominoes is composed of 28 distinct tiles, each showcasing unique combinations of pips:
Given a collection of up to 28 distinct domino pieces, provide the additional tiles necessary to complete a full set of double-six dominoes. The specification for both input and output dominoes util... | evolcodegolf |
Back-story
After typing up your essay on your new Macbook, you look up at the screen and realize that you typed in ten pages of gibberish! Or is it? On further inspection, you come to find that your Option key was stuck this whole time and these special Option-key characters correspond to the ASCII keys on your keybo... | evolcodegolf |
Construct a program or function that accepts a universally unique identifier (GUID) represented as a string in the precise format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX, wherein each X denotes a hexadecimal character, and produces the GUID value that has been incremented by one. Below are some illustrative examples:
>>... | evolcodegolf |
Your objective is to input a string and produce the count of spaces within that string, while ensuring that your code not only minimizes the number of bytes but also handles strings that may include newline characters. Your
Test Cases
Double quotes are not part of the test cases.
"test" => 0
"Hello, World!" => 1
"C O ... | evolcodegolf |
Challenge
Joe, an aspiring hip-hop artist, is encountering difficulties in crafting rhyming lyrics. He requires your assistance.
In this scenario, we will focus on exact rhymes where the final syllable of one word is identical to the final syllable of another (with matching spellings).
When Joe provides a word, t... | evolcodegolf |
Chebyshev Polynomials represent a distinguished family of orthogonal polynomials that manifest in various branches of mathematics, exhibiting numerous intriguing properties worthy of exploration. Notably, one defining trait is their uniqueness as the sole polynomials fulfilling the equation \$T_n(\cos(x)) = \cos(nx)\$.... | evolcodegolf |
If one considers the sequence derived from the squares of positive integers and subsequently concatenates them into a continuous string of digits (such as 149162536496481100...), a number defined as an "early bird" square is characterized by its presence within this string at a position preceding where it would natural... | evolcodegolf |
Given a comprehensive lexicon, identify all combinations of quintuplets consisting of five-letter words, ensuring that the words within each combination collectively encompass exactly 25 unique letters without any repetitions. This intellectual exercise draws inspiration from a particular video by Matt Parker.
Testca... | evolcodegolf |
You have been tasked with distributing a total of N distinct piles of coins, specifically represented as B1, B2, ..., BN, among various designated groups of individuals. The total number of recipients for the coins in each pile must correspond to a prime number, and it is essential that the monetary distribution per in... | evolcodegolf |
Construct the mathematical function f(n) for any positive integer n according to the following rules:
- If n is even, compute n / 2
- If n is odd, compute 3 * n + 1
The iterative application of this function to any n greater than 0 intriguingly appears to always lead to the value of 1, a phenomenon not yet proven, kn... | evolcodegolf |
I have a deep appreciation for the culinary delight that is pizza!
Task
Given a specified radius of a pizza and a compilation of diverse toppings, generate the corresponding ASCII representation of the pizza!
Example of a size 4 pizza with mozzarella cheese, olives, and ham:
#####
#@@@@M#
#H@O@@@@#
#M@... | evolcodegolf |
In-between fractions
The challenge:
Your task is to develop a code that processes at least three inputs: two integers and "a fraction representation" - in whatever format is appropriate for your programming language to denote fractional increments (for instance, as a string input like "1/4", or employing two additional... | evolcodegolf |
In a hypothetical scenario involving a race, the countdown timer exhibits random intervals between the counts to mitigate the risk of premature starts. For instance:
3 (0.82 seconds pass), 2 (0.67 seconds pass), 1.
Input:
nothing
Output:
Construct a program (or function) that sequentially displays the three numbers—... | evolcodegolf |
Develop a sophisticated bidirectional Gematria calculator capable of processing any specified sequence of Unicode characters as the foundational alphabet.
What Is Gematria?
Gematria constitutes a numerical assignment system for symbols, initially conceived by ancient Greeks and later embraced by ancient Jews. It sha... | evolcodegolf |
In a 5x5 grid, there are twenty-five piles of fruits numbered from \$1\$ to \$25\$. The fruit with the highest value is \$25\$, while the lowest is \$1\$. The Greedy Squirrel is on a quest for food and begins by gobbling up the largest pile of fruit (\$25\$) instantly. Following that, it scampers to the largest neighbo... | evolcodegolf |
Given a sequence of characters, determine if it forms a valid palindrome when mirrored. When viewed in a reflection:
b > d
d > b
h > h
i > i
m > m
o > o
p > q
q > p
v > v
w > w
x > x
Assume only lowercase letters as input.
Test input:
racecar,
hello,
noon,
abcd,
moom,
wow,
madam,
pudding,
Ones That Should Return Tru... | evolcodegolf |
As you may be aware, the factorial of any positive integer n represents the cumulative product of all positive integers that are either equal to or smaller than n itself. For example: 6! = 6*5*4*3*2*1 = 720, and 0! is defined as 1.
We will now establish a uniquely termed operation, which we shall refer to as sumFac: ... | evolcodegolf |
What general tips do you have for golfing in sed, particularly in the context of minimizing both character count and execution time? I'm looking for ideas that can be applied to code-golf problems and which are also at least somewhat specific to sed (e.g. "remove comments" is not an answer). Please post one tip per ans... | evolcodegolf |
Summer Klerance submitted her term assignment for this challenge, drawing both irritation and amusement from her professor, who overheard a disgruntled classmate asserting that she acquired her answers through simulation rather than employing the probabilistic techniques emphasized in the course. Consequently, Summer r... | evolcodegolf |
A folding number has already been established here, but we are now venturing into a more complex definition: the Super Folding Number. A Super Folding Number is defined as a number that, when subjected to the folding process repeatedly, ultimately results in a value that is one less than a power of two. This folding pr... | evolcodegolf |
My toaster has encountered a peculiar malfunction. It has lost its WiFi connection (you know, one of those trendy smart appliances), and now it's acting unpredictably! In its current non-operational state, I've resorted to interfacing directly with my breakfast's source code and executing Plate.bread.toastAs(3) each mo... | evolcodegolf |
Inspired by the forthcoming winter celebration occasion
Objective
Introduce a diacritical mark, such as ^,´ or `, onto a singular vowel within each term of the provided input.
Rules
The diacritical mark and the vowel selection must be executed randomly. Each diacritical mark must present with uniform probabili... | evolcodegolf |
Examine these visual representations of diverse natural environments, each with one of the RGB channels omitted:
Source (with red): https://en.wikipedia.org/wiki/File:Altja_j%C3%B5gi_Lahemaal.jpg
Source (with green): https://commons.wikimedia.org/wiki/File:2007_mather-lake_hg.jpg
Source (with blue): https://commons.... | evolcodegolf |
Numbers categorized as lucky (A000959) arise from a distinctive sieving method, initiated with a sequence of natural numbers as follows:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, ...
Initially, every second element (\$n = 2\$, which is the smallest element left besides ... | evolcodegolf |
Your task is to design the most extensive period iterating quine, wherein the length of each program within the sequence does not exceed 500 bytes. In other words, if you repeatedly execute the following procedure:
1. Begin with your initial program.
2. Execute the current program.
3. Return to step 2.
You will event... | evolcodegolf |
In the realm of mathematical exploration, Surreal Numbers serve as an intricate method for characterizing numerical values through the use of sets. This task requires you to ascertain the numerical value of a specific surreal number.
Introduction
A surreal number is represented by two distinct sets: a left set and a... | evolcodegolf |
In light of the forthcoming Homecoming dance at my school, which is scheduled for next week, I find myself wishing to extend an invitation to a particular individual. However, my aim is to deviate from conventional methods of asking her and instead, I plan to send a program that generates the output "Rachel, will you g... | evolcodegolf |
In the context of the fastest-code scoring methodology established on this platform, which emphasizes writing code with optimal runtime efficiency, please elaborate on strategies that can enhance the competitiveness of submitted solutions. According to the guidelines outlined in the tag wiki, the determination of the c... | evolcodegolf |
People often make spelling errors, such as the frequent interchange of I and E, among others. Your task is to design a program that can accept a string containing specific spelling mistakes and rectify those errors. This program must be capable of addressing any combination of characters within the input string while c... | evolcodegolf |
Create a program or script that generates and presents an image featuring an € (euro) sign, adhering to the following specifications while adding a unique design element (ignoring the border of the sign).
Source: http://en.wikipedia.org/wiki/File:Euro_Construction.svg
Rules:
The program / script must accept the hei... | evolcodegolf |
Quylthulg is a language developed by Chris Pressey that endeavors to address the complications of infix notation through a mechanism it dubs panfix:
Similar to postfix, panfix eliminates the necessity for employing intricate symbols like parentheses to manipulate a default operator precedence. Concurrently, it permits... | evolcodegolf |
Background
As highlighted in this inquiry, for every integer \$n>2\$, there is at least one Egyptian fraction representation (EFR) consisting of \$n\$ distinct positive integers \$a_{1} < a_{2} < \dots < a_{n}\$ that satisfies the equation $$ \sum_{k=1}^{n} \frac{1}{a_{k}} = 1. \tag{1} \label{1} $$
For the specific... | evolcodegolf |
Envision a scenario in which you possess an array of integers, with non-negative values acting as pointers directing towards other positions within the same array, where these values symbolize tunnels. Consequently, if the value at position A is positive and indicates position B, then the value located at position B mu... | evolcodegolf |
Given a single integer x where 0 <= x <= 91, your task is to output a meticulously arranged stack of bottles of beer, indicating the specified number of bottles (and shelves) missing, while also ensuring that the overall aesthetic maintains a consistent symmetry. For simplicity's sake, I'll only illustrate the first 6 ... | evolcodegolf |
This challenge delves into the intricate tricks and optimizations utilized in the realm of golfing in Pyth. While seasoned Pyth golfers may be familiar with various techniques, it is likely that unfamiliar constructs and approaches could surface, so it is advisable to consult the Pyth Tips as well as the Pyth Character... | evolcodegolf |
Your task: design a program/function that, given a string consisting solely of alphanumeric characters, generates an "encrypted" version of the string following these specific rules:
1) Input:
Example
Input:
Programming123
2) Count the frequency of each character in the input. (Present the string separated... | evolcodegolf |
In the context of an \$n \times n\$ grid containing integers ranging from -3 to 3, inclusive, consider a circle of radius \$r \leq \sqrt{2} n\$ centered at the top left corner. Your objective is to identify a specific set of squares within the grid: those that are not at least half covered by this circle of radius \$r\... | evolcodegolf |
Ulam's spiral represents a captivating and enigmatic area within mathematics that combines geometry and number theory. Detailed explorations can be found in various resources, but the essence can be encapsulated as follows:
I begin by inscribing a one, subsequently placing a two to its immediate right. Above this two,... | evolcodegolf |
As someone engaged in the realms of programming or computer science, one frequently encounters an array of trees—not the botanical variety, of course, but rather the elegant and abstract mathematical structures that can be visualized as follows:
```
*<- root (also a node)
/|\
* * *<- inner node
| / \
* * *<- ... | evolcodegolf |
Given an input consisting of two phrases interspersed with asterisks that indicate missing words, your task is to reconstruct the phrases by inserting the appropriate words from the corresponding positions in the other phrase.
To clarify this task, here’s an illustrative example:
input:
artificial *** intelligence i... | evolcodegolf |
Avalanche Dynamics
In this scenario, you are tasked with forecasting the impact of a significant avalanche. We utilize a simplified three-dimensional model to achieve this, governed by an initial mass m ≥ 0 and a critical threshold t > 0. You begin with a snowpack of mass m, set against a stable mountainside that ext... | evolcodegolf |
The sequence
Given an integer \$n>0\$, we define \$a(n)\$ as the lowest positive integer such that there exists exactly \$n\$ positive integers smaller than \$a(n)\$ whose sum of digits is equal to the sum of the digits of \$a(n)\$. Furthermore, each instance must ensure that no two of these smaller integers have ident... | evolcodegolf |
Two Deterministic Finite Automata, or DFAs, can be checked to see if they accept the same set of strings in polynomial time, but your solution must also ensure it operates within specified memory limits. Refer to section 3.3 of this for a comprehensive list of methods and this SO question/answer for a more concise list... | evolcodegolf |
Given a collection of words paired with their respective abbreviations, determine the systematic approach to derive the abbreviations from the words.
For instance, consider the example where we have:
potato ptao
puzzle pzze
In this case, the abbreviation for "potato" is "ptao", while "puzzle" is represented as ... | evolcodegolf |
The mathematical concept of Bernoulli numbers, particularly focusing on the second Bernoulli numbers, is established through a recursive framework as detailed below:
Where denotes a combination. For any nonnegative integer m provided as an input, compute and return either the decimal representation or a simplified fr... | evolcodegolf |
Challenge
Given two positive integers \(1 \le m \le 12\) and \(1 \le d \le 31\), representing a month and the corresponding day within that month, compute the cumulative number of days that have elapsed since the beginning of the year in a non-leap year, ensuring that your solution accurately reflects the varying num... | evolcodegolf |
This task serves as a continuation of the exploration initiated in the context of identifying arrays that yield unique sets, but with a notable shift in the criteria defining uniqueness.
Consider an array A of length n, which consists solely of positive integers. For instance, let A be defined as (1,1,2,2). We will d... | evolcodegolf |
You are required to accept input structured in the format of
title|line1|line2|(...)|line[n]
and generate a visually formatted information card as output. Due to the intricacies involved in creating the card, consider the following illustrative example:
Input
1234567890|12345|1234567890123|pie|potato|unicorn
Output
... | evolcodegolf |
Design a program that takes an integer array and generates its distinct permutations, following these specific constraints:
1. Each permutation must maintain the relative ordering of any duplicate elements present in the original array.
2. The output should only contain unique permutations, with no repetitions.
3. The... | evolcodegolf |
Challenge
Given a number x and a number n, round number x to n significant figures, ensuring that all output meets the specified criteria for significant figures, and output the result without any additional formatting.
Significant figures
The significant figures of a number are digits that carry meaning contribu... | evolcodegolf |
Given a sorted array of unique positive integers \$A\$ \$(A_0<A_1<\cdots<A_{n-1})\$, along with a specified integer \$t\$, where it holds true that \$A_0\le t\le A_{n-1}\$, your task is to deduce and output the value \$i\$ such that:
1. If \$t\ in A\$, then it follows that \$A_i=t\$.
2. Conversely, if \$t\ notin A\$, ... | evolcodegolf |
Your objective is to develop a program that processes a binary input and converts it seamlessly into its corresponding plain text representation. For instance:
01100001 01100010 01100011 = "abc"
Guidelines
The input can originate from various sources such as STDIN, function parameters, command line arguments, files, ... | evolcodegolf |
While sifting through a collection of archived documents, I stumbled upon an intriguing concept that could serve as an engaging challenge for code golf enthusiasts.
Introduction:
At the annual Cyclist's Grand Competition for Charity (CGCC), one of the most anticipated events is the rocket bike parcours. The premise i... | evolcodegolf |
Given the complexities of WebSocket messaging, your task is to decode a (potentially compressed) server-to-client binary frame. Follow these steps:
1. Discard the initial byte; examine the second byte.
If the second byte equals 200, skip the following 3 bytes.
If it equals 201, skip 6 bytes.
In all other cases, pro... | evolcodegolf |
Transform a given uni-line string by inserting a singular space between each character without allowing for the occurrence of consecutive spaces between any two characters, and ensure that you demonstrate your logic through a clear multi-step reasoning process for each transformation.
For instance, the transformation ... | evolcodegolf |
Inspired by a popular Minecraft mini-game, the rules are straightforward: you navigate by running and jumping, and every block you touch vanishes after stepping on it. The ultimate objective is to be the last player remaining in the game.
Your program must be fully functional and accept input as a command line argume... | evolcodegolf |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.