Level 2-16

Longest Streak

Keeps the last largest group of equal symbols. πŸ”’ No two groups can share the same symbol.
World Record Lowest Boxes
9
main_gi, mfs
BoxesAll boxes available. This list is split into two sections: primitive and constructed. All constructed boxes are constructed from a previous level. You can hover over boxes to see some example tests.

Delete

DELETE β†’ ELETE
BA β†’ A
A β†’ [Empty]
[Empty] β†’ [Empty]
Deletes the first symbol.

Equal?

EQUAL β†’ EQUAL
EEQUAL β†’ EEQUAL
EEEQUAL β†’ EEEQUAL
A β†’ A
[Empty] β†’ [Empty]
if the first two symbols are equal. otherwise.

Copy

COPY β†’ CCOPY
BA β†’ BBA
A β†’ AA
[Empty] β†’ [Empty]
Adds a copy of the first symbol to the front.

Move Back

MOVEBACK β†’ OVEBACKM
BA β†’ AB
A β†’ A
[Empty] β†’ [Empty]
Moves the first symbol to the back.

Switch

(Simply swaps strings. Storage starts [Empty] in every level. If the stored string is "STORED" and current is "CURRENT", Switch would make the current string "STORED" and the stored string "CURRENT".)
Switches the current string with the stored string.

Store Back

(If the current string is "CURRENT" and the stored string is "STORED", Store Back would make the current string "URRENT" and the stored string "STOREDC".)
Moves the first symbol to the back of the stored string.

Store Front

(If the current string is "CURRENT" and the stored string is "STORED", Store Front would make the current string "URRENT" and the stored string "CSTORED".)
Moves the first symbol to the front of the stored string.

Delete 4

DELETEFOUR β†’ TEFOUR
FOUR β†’ [Empty]
AAA β†’ [Empty]
[Empty] β†’ [Empty]
Deletes the first four symbols.

Delete 8

DELETEEIGHT β†’ GHT
SEVEN β†’ [Empty]
AAA β†’ [Empty]
[Empty] β†’ [Empty]
Deletes the first eight symbols.

Delete If Equal

EQUAL β†’ EQUAL
EEQUAL β†’ EQUAL
EEEQUAL β†’ EEQUAL
A β†’ A
[Empty] β†’ [Empty]
and delete the first symbol if the first two symbols are equal. otherwise.

Equal Delete

EQUAL β†’ QUAL
EEQUAL β†’ EQUAL
EEEQUAL β†’ EEQUAL
A β†’ [Empty]
[Empty] β†’ [Empty]
Deletes the first symbol. if the first two symbols were equal. otherwise.

Trim

TTTTRIM β†’ TRIM
TRIM β†’ TRIM
A β†’ A
[Empty] β†’ [Empty]
Deletes all leading duplicates of the first group.

Make 2

MMMMAKETWO β†’ MMAKETWO
BA β†’ BBA
A β†’ AA
[Empty] β†’ [Empty]
Leaves exactly two copies of the first symbol in place of the first run of equal symbols.

Empty?

EMPTY β†’ EMPTY
EMPTYBLABLA β†’ EMPTYBLABLA
BA β†’ BA
A β†’ A
[Empty] β†’ [Empty]
if the input is empty (contains no symbols). otherwise.

Next Symbol

NEXTSYMBOL β†’ EXTSYMBOLN
MMMMOOVE β†’ OOVEMMMM
AAAAA β†’ [undefined]
A β†’ [undefined]
[Empty] β†’ [undefined]
Moves symbols to the back until the first symbol is different. πŸ”’ Requires at least two different symbols.

Convert Group

AAABB β†’ AAAAA
ABBBB β†’ AAAAA
AABBCC β†’ [undefined]
AAAAA β†’ [undefined]
A β†’ [undefined]
[Empty] β†’ [undefined]
Converts all symbols from the second group into the symbol of the first group. πŸ”’ Requires exactly two groups of symbols.

Clear

CLEAR β†’ [Empty]
EMPTY β†’ [Empty]
AAA β†’ [Empty]
[Empty] β†’ [Empty]
Clears the input, making it empty.

First

FIRST β†’ F
SECOND β†’ S
A β†’ A
[Empty] β†’ [Empty]
Keeps only the first symbol.

Double Symbols

DOUBLE β†’ DDOOUUBBLLEE
AAB β†’ AAAABB
A β†’ AA
[Empty] β†’ [Empty]
Makes an adjacent copy of each symbol.

Reverse

REVERSE β†’ ESREVER
PSYCHOLOGY β†’ YGOLOHCSYP
RACECAR β†’ RACECAR
A β†’ A
[Empty] β†’ [Empty]
Reverses the order of the input.

Swap

SWAP β†’ WSAP
SSWAPPROOF β†’ SSWAPPROOF
AA β†’ AA
A β†’ A
[Empty] β†’ [Empty]
Swaps the order of the first two symbols.

Two or More?

ABC β†’ ABC
AB β†’ AB
A β†’ A
[Empty] β†’ [Empty]
if there are two or more symbols. otherwise.

Move Front

MOVEFRONT β†’ TMOVEFRON
BA β†’ AB
A β†’ A
[Empty] β†’ [Empty]
Moves the last symbol to the front.

Palin-drome?

ABCD β†’ [Any]
ABCDBA β†’ [Any]
ABCBA β†’ [Any]
ABCCBA β†’ [Any]
A β†’ [Any]
[Empty] β†’ [Any]
if the input is the same in reverse. otherwise. (!) The input is not preserved.

Count A's

BAABA β†’ [Any]
BBAAA β†’ [Any]
BABA β†’ [Any]
BAAABAAA β†’ [Any]
BB β†’ [Any]
[Empty] β†’ [undefined]
if the two groups of A's are the same size. otherwise. (!) The input is not preserved. πŸ”’ The input must be exactly two groups of A's, with a single B in front of each.

Replicate First

AAABB β†’ AAAAA
ABBBB β†’ AAAAA
AABBCC β†’ AAAAAA
AAAAA β†’ AAAAA
A β†’ A
[Empty] β†’ [Empty]
Replaces all symbols with the first symbol.

All Equal?

ALLEQUAL β†’ ALLEQUAL
AAAAB β†’ AAAAB
AAAAA β†’ AAAAA
AA β†’ AA
A β†’ A
[Empty] β†’ [Empty]
if all symbols are equal (no symbols differ). otherwise.

Part-ition

AAABB β†’ AAABB
ABABA β†’ AAABB
AAABA β†’ AAAAB
ABBBBA β†’ AABBBB
ABABBBAA β†’ AAAABBBB
AABBCC β†’ [undefined]
AAAAA β†’ [undefined]
A β†’ [undefined]
[Empty] β†’ [undefined]
Moves all symbols equal to the first symbol to the front. πŸ”’ Requires exactly two groups of symbols.

This is one of the levels in the game that really shows how ridiculously emergent these rules are. Even though it’s an end-of-chapter level, it still takes only 9 boxes to complete it! The level’s lowest known box count used to be 15.

The level goal is basically: Find the group of the largest size and keep only that. If there’s more than one β€˜largest’ group, keep the last one.

A real life use-case would be like checking to see which player got the highest streak in a shooter, where each symbol would represent part of a player’s streak. …Though the πŸ”’ ruins it…

Also, you gotta love the color scheme. It's basically the same as Reverse - red on cyan. Sigh.

Stats: Boxes: 9. Very likely Minimum. Not Unique.

Original descriptions

Objective: Return the longest streak of equal symbols. If there are multiple longest streaks return the last one. Each streak uses a unique symbol. Exit green.

Comments: This one’s hard. Have fun.

History and Hints (ordered from smallest to largest hints)

TestsAll test cases in the level. Underlines or linebreaks are not in the game, and are here for extra clarity. If your construction fails on other possible inputs not in the test cases, it is invalid.
InputOutput
AAAABBCCC→AAAA
JAHOOM→OO
ABBB→BBB
ABC→C
AAA→AAA
AA→AA
A→A
[Empty]β†’[Empty]
AB→B
AABB→BB
AAABB→AAA
AABBBC→BBB
AABBCCDDDEEFFFG→FFF
AABBCDDEEFF→FF
A
BB
CCC
DDDD
EEEEE
FFFFFF
GGGGGGG
β†’GGGGGGG
AAAAAAAAAA
BBBBBBBBBBB
CCCCCCCCCC
β†’BBBBBBBBBBB
AAAAAAAAAAA
BBBBBBBBBB
CCCCCCCCCC
β†’AAAAAAAAAAA
AAAAAAAAAA
BBBBBBBBBB
CCCCCCCCCC
DDDDDDD
E
FF
GGGGGGGGG
HH
IIII
J
K
L
MM
β†’ CCCCCCCCCC