Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Post History

66%
+2 −0
Challenges Are these reduced forms of the same thing?

Task You are going to take three strings as input $A$, $B$ and $X$. And your goal is to determine if there exists a third string $S$ such that both $A$ and $B$ can be formed by iteratively removin...

0 answers  ·  posted 1y ago by WheatWizard‭  ·  edited 1y ago by WheatWizard‭

#6: Post edited by user avatar WheatWizard‭ · 2023-06-22T11:55:37Z (over 1 year ago)
Better wording.
  • # Task
  • You are going to take three strings as input $A$, $B$ and $X$. And your goal is to determine if there exists a third string $S$ such that both $A$ and $B$ can be formed by iteratively removing contiguous substrings of $S$ that are equal to $X$. For example if $X = 10101$ then both $10$ and $01$ can be formed from the starting string $S = 1010101$
  • $$
  • 10\,\,(10101) \rightarrow 10
  • $$
  • $$
  • (10101)\,\,01 \rightarrow 01
  • $$
  • Input may be either a list of positive integers or a string of alphanumberic ascii characters. Output should be one of two distinct consistent values for each of the cases. One value should be given if an $S$ exists, and the other if not.
  • This is code-golf. The goal is to minimize the size of your source code as measured in bytes.
  • # Test cases
  • ## True
  • The following cases should give a *true* value. In each I give an example $S$, but this is neither input nor output, it is just provided for demonstration.
  • ```text
  • A, B, X -> S
  • 10, 0110, 01 -> 0110
  • 10, 001110, 01 -> 001110
  • 10, 01, 10101 -> 1010101
  • 1100, 0101, 10101 -> 11010101101010110101011010101
  • 102, 021, 1021021 -> 1021021021
  • 10, 01, 1010101 -> 101010101
  • ```
  • ## False
  • ```text
  • A, B, X
  • 100, 01, 10101
  • 10201, 1100, 10
  • 10, 01, 001
  • 10, 01, 1010
  • ```
  • # Task
  • You are going to take three strings as input $A$, $B$ and $X$. And your goal is to determine if there exists a third string $S$ such that both $A$ and $B$ can be formed by iteratively removing contiguous instances of $X$ in $S$. For example if $X = 10101$ then both $10$ and $01$ can be formed from the starting string $S = 1010101$
  • $$
  • 10\,\,(10101) \rightarrow 10
  • $$
  • $$
  • (10101)\,\,01 \rightarrow 01
  • $$
  • Input may be either a list of positive integers or a string of alphanumberic ascii characters. Output should be one of two distinct consistent values for each of the cases. One value should be given if an $S$ exists, and the other if not.
  • This is code-golf. The goal is to minimize the size of your source code as measured in bytes.
  • # Test cases
  • ## True
  • The following cases should give a *true* value. In each I give an example $S$, but this is neither input nor output, it is just provided for demonstration.
  • ```text
  • A, B, X -> S
  • 10, 0110, 01 -> 0110
  • 10, 001110, 01 -> 001110
  • 10, 01, 10101 -> 1010101
  • 1100, 0101, 10101 -> 11010101101010110101011010101
  • 102, 021, 1021021 -> 1021021021
  • 10, 01, 1010101 -> 101010101
  • ```
  • ## False
  • ```text
  • A, B, X
  • 100, 01, 10101
  • 10201, 1100, 10
  • 10, 01, 001
  • 10, 01, 1010
  • ```
#5: Post edited by user avatar WheatWizard‭ · 2023-06-22T11:24:48Z (over 1 year ago)
  • # Task
  • You are going to take three strings as input $A$, $B$ and $X$. And your goal is to determine if there exists a third string $S$ such that both $A$ and $B$ can be formed by iteratively removing contiguous substrings of $X$ from $S$. For example if $X = 10101$ then both $10$ and $01$ can be formed from the starting string $S = 1010101$
  • $$
  • 10\,\,(10101) \rightarrow 10
  • $$
  • $$
  • (10101)\,\,01 \rightarrow 01
  • $$
  • Input may be either a list of positive integers or a string of alphanumberic ascii characters. Output should be one of two distinct consistent values for each of the cases. One value should be given if an $S$ exists, and the other if not.
  • This is code-golf. The goal is to minimize the size of your source code as measured in bytes.
  • # Test cases
  • ## True
  • The following cases should give a *true* value. In each I give an example $S$, but this is neither input nor output, it is just provided for demonstration.
  • ```text
  • A, B, X -> S
  • 10, 0110, 01 -> 0110
  • 10, 001110, 01 -> 001110
  • 10, 01, 10101 -> 1010101
  • 1100, 0101, 10101 -> 11010101101010110101011010101
  • 102, 021, 1021021 -> 1021021021
  • 10, 01, 1010101 -> 101010101
  • ```
  • ## False
  • ```text
  • A, B, X
  • 100, 01, 10101
  • 10201, 1100, 10
  • 10, 01, 001
  • 10, 01, 1010
  • ```
  • # Task
  • You are going to take three strings as input $A$, $B$ and $X$. And your goal is to determine if there exists a third string $S$ such that both $A$ and $B$ can be formed by iteratively removing contiguous substrings of $S$ that are equal to $X$. For example if $X = 10101$ then both $10$ and $01$ can be formed from the starting string $S = 1010101$
  • $$
  • 10\,\,(10101) \rightarrow 10
  • $$
  • $$
  • (10101)\,\,01 \rightarrow 01
  • $$
  • Input may be either a list of positive integers or a string of alphanumberic ascii characters. Output should be one of two distinct consistent values for each of the cases. One value should be given if an $S$ exists, and the other if not.
  • This is code-golf. The goal is to minimize the size of your source code as measured in bytes.
  • # Test cases
  • ## True
  • The following cases should give a *true* value. In each I give an example $S$, but this is neither input nor output, it is just provided for demonstration.
  • ```text
  • A, B, X -> S
  • 10, 0110, 01 -> 0110
  • 10, 001110, 01 -> 001110
  • 10, 01, 10101 -> 1010101
  • 1100, 0101, 10101 -> 11010101101010110101011010101
  • 102, 021, 1021021 -> 1021021021
  • 10, 01, 1010101 -> 101010101
  • ```
  • ## False
  • ```text
  • A, B, X
  • 100, 01, 10101
  • 10201, 1100, 10
  • 10, 01, 001
  • 10, 01, 1010
  • ```
#4: Post edited by user avatar trichoplax‭ · 2023-06-22T11:23:38Z (over 1 year ago)
Typos
Are these reduced forms of the same thing?
  • # Task
  • You are going to take three strings as input $A$, $B$ and $X$. And your goal is to determine if there exists a third string $S$ such that both $A$ and $B$ can be formed by iteratively removing contiguous substrings of $X$ from $S$. For example if $X = 10101$ then both $10$ and $01$ can be formed from the staring string $S = 1010101$
  • $$
  • 10\,\,(10101) \rightarrow 10
  • $$
  • $$
  • (10101)\,\,01 \rightarrow 01
  • $$
  • Input may be either a list of positive integers or a string of alphanumberic ascii characters. Output should be one of two distinct consistent values for each of the cases. One value should be given if an $S$ exists, and the other if not.
  • This is code-golf the goal is to minimize the size of your source code as measured in bytes.
  • # Test cases
  • ## True
  • The following cases should give a *true* value. In each I give an example $S$, but this is neither input nor output, it is just provided for demonstration.
  • ```text
  • A, B, X -> S
  • 10, 0110, 01 -> 0110
  • 10 001110, 01 -> 001110
  • 10, 01, 10101 -> 1010101
  • 1100, 0101, 10101 -> 11010101101010110101011010101
  • 102, 021, 1021021 -> 1021021021
  • 10, 01, 1010101 -> 101010101
  • ```
  • ## False
  • ```text
  • A, B, X
  • 100, 01, 10101
  • 10201, 1100, 10
  • 10, 01, 001
  • 10, 01, 1010
  • ```
  • # Task
  • You are going to take three strings as input $A$, $B$ and $X$. And your goal is to determine if there exists a third string $S$ such that both $A$ and $B$ can be formed by iteratively removing contiguous substrings of $X$ from $S$. For example if $X = 10101$ then both $10$ and $01$ can be formed from the starting string $S = 1010101$
  • $$
  • 10\,\,(10101) \rightarrow 10
  • $$
  • $$
  • (10101)\,\,01 \rightarrow 01
  • $$
  • Input may be either a list of positive integers or a string of alphanumberic ascii characters. Output should be one of two distinct consistent values for each of the cases. One value should be given if an $S$ exists, and the other if not.
  • This is code-golf. The goal is to minimize the size of your source code as measured in bytes.
  • # Test cases
  • ## True
  • The following cases should give a *true* value. In each I give an example $S$, but this is neither input nor output, it is just provided for demonstration.
  • ```text
  • A, B, X -> S
  • 10, 0110, 01 -> 0110
  • 10, 001110, 01 -> 001110
  • 10, 01, 10101 -> 1010101
  • 1100, 0101, 10101 -> 11010101101010110101011010101
  • 102, 021, 1021021 -> 1021021021
  • 10, 01, 1010101 -> 101010101
  • ```
  • ## False
  • ```text
  • A, B, X
  • 100, 01, 10101
  • 10201, 1100, 10
  • 10, 01, 001
  • 10, 01, 1010
  • ```
#3: Post undeleted by user avatar WheatWizard‭ · 2023-06-22T01:47:08Z (over 1 year ago)
#2: Post deleted by user avatar WheatWizard‭ · 2023-06-22T01:44:17Z (over 1 year ago)
#1: Initial revision by user avatar WheatWizard‭ · 2023-06-22T00:15:48Z (over 1 year ago)
Are these reduced forms of the same thing?
# Task

You are going to take three strings as input $A$, $B$ and $X$. And your goal is to determine if there exists a third string $S$ such that both $A$ and $B$ can be formed by iteratively removing contiguous substrings of $X$ from $S$.  For example if $X = 10101$ then both $10$ and $01$ can be formed from the staring string $S = 1010101$

$$
10\,\,(10101) \rightarrow 10
$$
$$
(10101)\,\,01 \rightarrow 01
$$

Input may be either a list of positive integers or a string of alphanumberic ascii characters.  Output should be one of two distinct consistent values for each of the cases. One value should be given if an $S$ exists, and the other if not.

This is code-golf the goal is to minimize the size of your source code as measured in bytes.

# Test cases

## True
The following cases should give a *true* value. In each I give an example $S$, but this is neither input nor output, it is just provided for demonstration.

```text
A, B, X -> S
10, 0110, 01 -> 0110
10  001110, 01 -> 001110
10, 01, 10101 -> 1010101
1100, 0101, 10101 -> 11010101101010110101011010101
102, 021, 1021021 -> 1021021021
10, 01, 1010101 -> 101010101
```

## False

```text
A, B, X
100, 01, 10101
10201, 1100, 10
10, 01, 001
10, 01, 1010
```