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 β ELETEBA β A A β [Empty] [Empty] β [Empty] |
Deletes the first symbol. |

Equal? EQUAL β EQUALEEQUAL β EEQUAL EEEQUAL β EEEQUAL A β A [Empty] β [Empty] |
if the first two symbols are equal. otherwise. |

Copy COPY β CCOPYBA β BBA A β AA [Empty] β [Empty] |
Adds a copy of the first symbol to the front. |

Move Back MOVEBACK β OVEBACKMBA β 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 β TEFOURFOUR β [Empty] AAA β [Empty] [Empty] β [Empty] |
Deletes the first four symbols. |

Delete 8 DELETEEIGHT β GHTSEVEN β [Empty] AAA β [Empty] [Empty] β [Empty] |
Deletes the first eight symbols. |

Delete If Equal EQUAL β EQUALEEQUAL β EQUAL EEEQUAL β EEQUAL A β A [Empty] β [Empty] |
and delete the first symbol if the first two symbols are equal. otherwise. |

Equal Delete EQUAL β QUALEEQUAL β EQUAL EEEQUAL β EEQUAL A β [Empty] [Empty] β [Empty] |
Deletes the first symbol. if the first two symbols were equal. otherwise. |

Trim TTTTRIM β TRIMTRIM β TRIM A β A [Empty] β [Empty] |
Deletes all leading duplicates of the first group. |

Make 2 MMMMAKETWO β MMAKETWOBA β BBA A β AA [Empty] β [Empty] |
Leaves exactly two copies of the first symbol in place of the first run of equal symbols. |

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

Moves symbols to the back until the first symbol is different. π Requires at least two different symbols. | |

Convert Group AAABB β AAAAAABBBB β 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 β FSECOND β S A β A [Empty] β [Empty] |
Keeps only the first symbol. |

Double Symbols DOUBLE β DDOOUUBBLLEEAAB β AAAABB A β AA [Empty] β [Empty] |
Makes an adjacent copy of each symbol. |

Reverse REVERSE β ESREVERPSYCHOLOGY β YGOLOHCSYP RACECAR β RACECAR A β A [Empty] β [Empty] |
Reverses the order of the input. |

Swap SWAP β WSAPSSWAPPROOF β SSWAPPROOF AA β AA A β A [Empty] β [Empty] |
Swaps the order of the first two symbols. |

Two or More? ABC β ABCAB β AB A β A [Empty] β [Empty] |
if there are two or more symbols. otherwise. |

Move Front MOVEFRONT β TMOVEFRONBA β 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 β AAAAAABBBB β AAAAA AABBCC β AAAAAA AAAAA β AAAAA A β A [Empty] β [Empty] |
Replaces all symbols with the first symbol. |

All Equal? ALLEQUAL β ALLEQUALAAAAB β AAAAB AAAAA β AAAAA AA β AA A β A [Empty] β [Empty] |
if all symbols are equal (no symbols differ). otherwise. |

Part-ition AAABB β AAABBABABA β 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*.

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.

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.

Input | Output | |
---|---|---|

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 |