Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,21 @@
|
|||
longestChain[list_] :=
|
||||
NestWhileList[
|
||||
Append @@@
|
||||
Select[DeleteDuplicatesBy[
|
||||
Tuples[{#, list}], {#[[1, 1]], #[[2]]} &], ! MemberQ @@ # &&
|
||||
StringTake[#[[1, -1]], -1] == StringTake[#[[2]], 1] &] &,
|
||||
List /@ list, # != {} &][[-2, 1]];
|
||||
Print[longestChain[{"audino", "bagon", "baltoy", "banette", "bidoof",
|
||||
"braviary", "bronzor", "carracosta", "charmeleon", "cresselia",
|
||||
"croagunk", "darmanitan", "deino", "emboar", "emolga",
|
||||
"exeggcute", "gabite", "girafarig", "gulpin", "haxorus",
|
||||
"heatmor", "heatran", "ivysaur", "jellicent", "jumpluff",
|
||||
"kangaskhan", "kricketune", "landorus", "ledyba", "loudred",
|
||||
"lumineon", "lunatone", "machamp", "magnezone", "mamoswine",
|
||||
"nosepass", "petilil", "pidgeotto", "pikachu", "pinsir",
|
||||
"poliwrath", "poochyena", "porygon2", "porygonz", "registeel",
|
||||
"relicanth", "remoraid", "rufflet", "sableye", "scolipede",
|
||||
"scrafty", "seaking", "sealeo", "silcoon", "simisear", "snivy",
|
||||
"snorlax", "spoink", "starly", "tirtouga", "trapinch", "treecko",
|
||||
"tyrogue", "vigoroth", "vulpix", "wailord", "wartortle",
|
||||
"whismur", "wingull", "yamask"}]];
|
||||
Loading…
Add table
Add a link
Reference in a new issue