Desafío:
Cree un programa que comprima una cadena semialeatoria y otro programa que la descomprima. La pregunta es bastante similar a esta de 2012 , pero las respuestas probablemente serán muy diferentes y, por lo tanto, afirmaría que esto no es un duplicado.
Las funciones deben probarse en 3 cadenas de control que se proporcionan en la parte inferior.
Las siguientes reglas son para ambos programas:
Las cadenas de entrada se pueden tomar como argumento de función o como entrada del usuario. La cadena comprimida debe imprimirse o almacenarse en una variable accesible . Acceso significa que al final del programa, que se puede imprimir / mostrar usando disp(str)
, echo(str)
o el equivalente en su idioma.
Si no se imprime automáticamente, se debe agregar un comando que imprima el resultado al final del programa, pero no se incluirá en el recuento de bytes. Está bien imprimir más que el resultado, siempre que sea obvio cuál es el resultado. Entonces, por ejemplo en MATLAB, simplemente omitir ;
al final está bien.
Comprimir una cadena de longitud máxima no debería tomar más de 2 minutos en cualquier computadora portátil moderna. Lo mismo ocurre con la descompresión.
Los programas pueden estar en diferentes idiomas si, por alguna razón, alguien quiere hacer eso.
Las cuerdas:
Para ayudarlo a crear un algoritmo, a continuación se explica cómo se componen las cadenas :
Primero, algunas definiciones. Todas las listas y vectores están indexados a cero usando paréntesis []
. Los paréntesis (n)
se utilizan para construir una cadena / vector con n
elementos.
c(1) = 1 random printable ascii-character (from 32-126, Space - Tilde)
c(n) = n random printable ascii-characters in a string (array of chars ++)
a*c(1) = 1 random printable ascii-character repeated a times
r(1) = 1 random integer
r(n) = n random integers (vector, string, list, whatever...)
c(1) + 2*c(1) + c(3) = 1 random character followed by a random character repeated 2
times followed by 3 random characters
La cadena se compondrá de la siguiente manera:
N = 4 // Random integer (4 in the following example)
a = r(N) // N random integers, in this example N = 4
string = a[0]*c(1) + c(a[1]) + a[2]*c(1) + c(a[3])
Nota: las llamadas repetidas a c(1)
darán valores diferentes cada vez.
Como ejemplo:
N = 4
a = (5, 3, 7, 4)
string: ttttti(vAAAAAAA=ycf
5 veces t
(carácter aleatorio), seguido de i(v
(3 caracteres aleatorios), seguido de 7 veces A
(carácter aleatorio) seguido de =ycf
(4 caracteres aleatorios).
Para el propósito de este desafío, puede suponer que , N > 10
y N < 50
cada segundo número aleatorio en A
es mayor 50
y menor que 500
, mientras que los otros números aleatorios pueden ser de 1
a 200
. Como ejemplo:
N = 14
a = (67, 48, 151, 2, 51, 144, 290, 23, 394, 88, 132, 53, 77, 31)
La puntuación será la longitud combinada (bytes) de los dos programas, multiplicada por la tasa de compresión al cuadrado.
La tasa de compresión es el tamaño de los datos comprimidos dividido por el tamaño de los datos originales. Se utiliza la tasa promedio para las tres cadenas.
score = (Bytes in program 1 + Bytes in program 2)*(Compression rate)^2
El ganador será el que tenga la puntuación más baja dentro de dos semanas.
Cadenas de prueba:
Cadena 1 (5022 caracteres):
TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTX_w}yo7}vWL$Y@qNR*Xxqt|oqmwr4+32ejdnaKdEf1<a?<iEKswv)HcNyF/pGc).SPpCF-j$& 1**(NNZ.>Zy0e-`a)i$1Z,X[hcR5JX18wG|`9:H;Qi&nluCKC:b! Q+)i77B28/j/4ZYT1=FN!>DR7'yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyeDW,FmJh.%AgO&<CIO|Z>gSmszi/I?nL3P8)se$cbNit%['G<X9VW/)+Xg%$Y}E98\X o;y<Jf8(,8=i`v\e B\7\?<\!Pht(U7FFg\!\L_&bh=G*IJLPLpKGc@ 3j9E%{z^+'3bFmM3q"|c2Gt#ed%-U+y?<bB'/[I]o}bmyE=Y$h!oo/H,9$&^*7Rbzd.L;KGN-Wllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllgk4D:*\(Kt);&^0:RL.KB)IqS79Xj)c8qhf5+S=Up%y0xj%1lA=C<.^F*!UuE2u4wbZ[1#?Q)wz*E;;_5 w\{VUBqH}0(tE& HV(4eZ}S@7xi_s]nzwtP2$8_v`)BDFEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEzgGFo9b8`U':3H<;;K)D'B4:L'}7x;3d]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*'wt#^or$m_F{@D"`[n?x1Ow3H1bh$5Z@yzRJ4=my&%X+bc6Or/Bw`Zx,VO{Ss10}[fKFLX}Rh9W?_k7)\&j\`Z.BABUy'q8\VP5D_n-f|v3Y$cLe;;7r{5lD@uc?r/c+&O=0{Hr!5&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&9<OIozM4dNlw9N-MUW<kwD/E]XB^1/(?)?C4x)%p,K)p#<cG&PMV"10"&+vN-/oKw9FsubG=*&c'A)a Tu)uZD,S{c|<QO}w+[Pdc=$}3f(!73W?Ko!z:gPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP(!B"n}ydQP W^]2!$,0,ym! cVy4U>hmsNbdU}b-T`n'B^:L#Z}pI5l+46(1LCS>:BAp8+?[ ?}}1mtpo3\[{I]!7T33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333FzE klH&6Cj[VPd: HB\e9FvH_./lxP*Z\LD-,Y``IegX+=1T_:B>VJ{Ikq>'_>k5>rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr"EI5K,%OB??_{"fNG>Ql6"jJ4m[S{I_/`P000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000=K#Gc-0ai'N"zDO[roJAJOPPY!%C#+J7"xd0V^teUZX$QW!<\s 3kuuXS'W`F mUvkzr7R ET"(2Y9c}M-a&shkT9j>*x+KDprC'9WFXl(`I{AfsCffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffvKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK#v>boc"..................................................................................................................................................................................................a#,uAOemp[b5CPOzI85g:a[|:]<Ss=`JuIB]+Sg$b'>PJ=%:zM#I$,YM1eX)Ja=P5x^WhuVt1?$ZU5qoM68P?n;T]R-RZ0PMH^pS%W*so-v!=2Z=9J^p,j$4)"'mXvWFF]IQN^MqG:^Lr&V?is6A%N${wNjCXpJE+F^wBG4@c`c^/CU-}8TIYJHu$|KGq=\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\l7G7DK9Nq+'{=>.^a"I<ytX0(HsP'x:I4enw5'^kjQ{ZQta\FL|zOC2C[d4y\z8'z<OgHw3+XZ_nSq@B9m)Yu"|JkOTP*L3T"t\<'sh,y*{0%*NBBBBBBBBBBBBBBBBBBBBBBBB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NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNIv%x1QT@:A`TeVc"AVnFzfPGN%^</a=G=#P/G/oAS^ZPI-8yhu0T8>V5kF80Gh;QU=SC>ymTH{Onh/)[kN+:y .iRj[yK!V HDFW<<fU&zmm2.OY-H^Gf)yH{R%>5DNI]'AX7-kpEJr`+IM-cUn S{co^]ir%J,(P/[q1 h},R",d\Kg%(*HpGDEq`=ubhTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTgeQ_!6|Qj$L77777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777>JV8&V]xq4k#U)5e^8VTJPRzD)HeT6STV:WgqwBbF61R/{_x=diD{<5jKf/Yds7.;Eu}[bYDyA1wRA{-S:1l[%5dHHVOgWMQBy">VO^fJ4yn>oN.,1LEzxT.)>cHk!PbB|$#."Jg^;8}\% D>*8e))=OnSNhRQ
Cadena 2 (2299 caracteres):
VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV`]e!oO{=i&}\o8^('MDPC`VCI`(@3AFa"A3Dhc<h2Rhc99F^$<LpAOdzC6Y%dTm:!iHH@&&OCV?y)Vv [`wq=?0-YjXSPx1t3k&=>(6^EW?%pH3y6Rb8="2tG%$Jo6A<X^nS4K\v@nZ(Bi1jCW4?p]aIv}<26gXQ%'GKa*<$aPOnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn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}0.-ySF2zWy_3gwpmcqWZZ'Y))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))X']&p]icj|RFj'ci2*1jXg%* Eu&9QZEWwGpen1Pa,Gti_?FUL)&=r<YL-Th"]f%jV<Kx);@L^)mw'g S(nry%kbZp pGD]R@j3{idSHH<!X{%(/T,ow]$259a P-6_AX*o?4g^>(n<v^:/U@cmh9nOG|ot=8Rw5FfvU/'IGD(gm++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++K#&U4RN$dR*rv1p5t`<n7XpvpVz#uncF647sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssYl?CCkw#e?#be5,c0GttH}N j:$5AHa Xz[<z-=CdX)@}fHmk7L-k&hZHOP5o9^yU%%:g|TD1b=7G !HKGMN|}/l:}2Ia^fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff56&4i{38sY*]<DTT#:5>RJm*\c&|kM+K\s^"055%FL5Fl&X|{q+4N6t^(<\gt@;v?z}xly?Bi_!mSA+8r/6n4)Kdh4)P8'|oK&-7tFNO:]mr$nl6L1jr):uC(vh`Ei)19MfumB<VtL]"Vc
Cadena 3 (10179 caracteres):
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""":=P,W$WS.vBP9d89L65VeuKY27|*-Ih1x/nY}p09Sq$PQ%4z!l*)@wmbP3b;C3E8#*?2-T`W"0&::+kA:`.OrjmD-u(oDpE:{x0 ttb13yO"q6U:1N@/[R2g}#y}d,7)_STJ^0hb]4]hSd9%L#]Bimmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm+HuOde&d,uX?B??|AJ)h.}D<HouV7NXUP0!.,HmhBaar7(c.)A#%8aPc{g8iE.hw0H)P5B^zQT('wG7Vu(|M>lo.5EM3Z/o&[Pfd}A{Vsi,+lAlam*K}69zlNWJv)|u0<e#+:l![((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((G#zx B)=N\[hRY8Dm`x@SPG=3ZRJ^SkywE:U/[\Z?q[fjY9gxO.]TiH)xKw}%*Tb[JhlD]2D4:(CE:#Zre/}9:z2*G)u)O,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,It)UnqhJ_XIzXNlT%C*Mq%R6KNTg=Q(4G)}=Q2Fp.A>Tuz?y4,wvh%,qQS5gb`6E>^6M]1FV/*4s%LDf%bwEr!oH.G/////////////////////////////////////////////////////////////////////////////////////////////////////JfITfs\Bp{8uJmAE@qW>QT!"R\q\q}2Rwo3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333q Kxp"zbN(am%qRC"bc#]zzD,sr]=H)yMS"0X&_/|yqs!kZ)`MY[C%3j`6$D!(Qk4x."e,m] ;B|S)E{BQT:%eSr0j7Gqx0&u7c7.lT]P?.&&mV2ZT^.k^"0)4K*#E4d!z/$#[-?zi8a(S?iIU9|q?lfy3T"}fh)oWfO5^{sAXu`CB*LStW5(KCe3I]-|oE^>!VL<#Pd$PLDBqZfQ)QPCWja7&7HtM7uM9*..................................................................................................................................................................v/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\sh*_l7Tk`b7KQueol'sWCC,5|\=H>v0I4c\PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP4q.r!#H?yY/-t2:iDRwn,TwSR6 v@lBv\jjO!Kz+1NT>ksfbl=hq)/y1q<}3"kYHLJ&&m'NS'lhqaPYJW3}3Qjh)|ZnAQvb^v=6TIw%Ry{!M,aBIzd9QLhB%cjXOoc*C\S0!(f :NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNv(9%9@j.1yF&fw@L9edFP3#7tuHlxpCk8]hD.ky{V6bS#?rEz5PERx_"V:\TN {2_"pE/T:X<#&<\V%IQISzo6w5vO%lvPx)|wO!"+>\t-SzP\wWXFQrmXp`JGJ/sIoVyns2u=yU`26&A1]vrpEXHD/K1HjnN4-t";S*****************************************************************************************************************************************************************a&.z "aV6]K"JhyO;/`UOpAkb}zP53=$AD:Io3lkjdUMjw1w!rL2Za3Dk:,`]AsG!L[3e^ECxxqx[I_{|qe)z;zZ#V&HZ:J4g+2U>}y!Oazq`qY_]'n=egXV9*IaFbtRZGVQG!ojmkTkStrbzFnd|7Keu [7$2f7Npb]ne=wuAg\9*4Rd/cqcDApSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS[OTjad;#l+*>m&fFSS{rc|xb?MTV$Z2I>)l8QfAUB"wNHhMNpvaz_TnvM:2Ck>*2=jWS2)a/$dP\,"pB9#L^1lSir+m%oG@YA/G#M3T10gF+xdJDqe"8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888":6Y<zLVYm@aQ-.\-u\M_.7<}L`(w!+7lm@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<aJHBA#?>9cSxN5HZ:$Z{Kr15x>cZ?!NACujxBVAu;->*BxS)wu dA:2#Sq:FaGgr5,mKLv&_ms"s1:NXEVVX)`y#ekL4H$;%{xrU$ai&9J5C8eqyQE(E|;+3tf^csoENQJG#}X81VE2m1xY 2SI d[*Eozzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz7/+M6f *n*GBp_/+rpBX@]%OpIgfkF":Cc"xzIGYw5H{LVBWFKg\1j{S duWiWB[-%'z7)NGE)QR >"t4#N1{(EntG)$u^o/J(*IaBAB<D\iE?gWj)ccWk-[OToXKjQZTWIji%^] ,Z#:_5Rsk e`s-bxrLW|(,c!>mmin\w5lcLO`````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````+b"0@z2a@N^IO}K{uefxE%pgz'!7GoJ2mLaOZh3#I$tSEZ/=x9S6]Y0[5T@qRftKeXuBFr_ \)-?-2">0r*=MB'hhf4x"%g8Y\[kmPx><6ejGL; s:yp@5af+rg=/`W(xm,{OKLzj dY/3PC)Ea]LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLcqGx?cJ"y,>w5jkIbja_qUNv#-r_G 86[090^^F@x|4(8@dWy`"MnL5<+Mf{IsyVO32xy@ZKS4.o2T`G$gNJbCddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd:>WH*?#n+7oFZQ\gLEzvR8LS6u&0^pR[;n`x&D9m"YFf````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````````G=Z^o74rpXU<`',;JPl|}/>8f<ir3M6;&O)Y4rV5T2^+AJ>QvlE([bozzb,ifw=BG7+P((lS$g{c!N*&_K<);rx,2&9@7QJi6Q*(.qFQys>EB['1a4(`?htRwJ"a+<j6*>.Lm}F)`:M3;=^n+Bp&\HZI[sv1FGI93\6VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV O}h4W!dP?}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}Z'lC(E *d#-Ub?y". r:D{n--gCk&=IpmT{\I-;2vQ18xtU'2u1<qAN<IF!YEwx)ZKvY_)D%CU;l1bC%$>u|W.(2=dC!{_e?bc32]DYC?m}<{vdZKnZ <.VhO?EYwINo7lS36Ir1p4Q%cG*7RX#)iVIu..............................................................................NuF1uxKoCH5[cn,,7uj "6aoUK_7hV|lb;u8Piim!{f4 dASS'mtQ&L_-jZ=a?=YwO%Q?y240o".T*]k",5]S*f(P?Rp?T1=V7[^T=w8_h>(:O%f?iZuaJ=3d`f[dI;8S@'Gz]zn%{_OAw7&T%-44444444444444444444444444444444444444444444444444444444444444444444uSz;a(-U)o.xYDgr0,Kyo+jsMrB^oQJ=V}U`nEB>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I/T;Qk/dyY_96VxX6=EGn%{'uzDF}.k!\}O^NG1p7PI<_C'/3%d70'@;\6n)wydLj}bZfWP9 zei[;J:^;BRwKcBFdFld3IRrRY9oBJ<#ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ/e{hh'&wP3jknjfma}v:*__SLUIg\@*_`m:fcbfj((6:1)..?,Xx6<%bi.9Z>)xC`Jbwv#mo_[O0z8>@Exm^>b.&2)[Eyg\Y{UZA9:+SuwhG(<w***********************************************************************************************************************************************************************s4NBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBJ_ h\ xgC46py]Wh'|,LnG2dgl1\*ZG2HWA0Z%26_zB(Y{:;2zxS?>5NJrX8j^*9bt$UQ\PD95El;e'EU6K.[:a&zn]$]`g^Wl;Q(o9oWI3HwTj}NR_:OAdJ@!M8#twm6+tN!*%ldWyOZpnGBeOyz\CiH9w>FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFVRA"MafX,*ZvJvhH{]BrDX">v}pMz2ze.q#$U1c_ XA207Zof^cE,(R`LgHdYY&etOFaShx`F])18.O#\go/-Q#!%6%O0)W`v$fX)7VSTUYau9TC|%a_'bI&i1i7Z3,om_'9(2m-ihn jCh5VrJPD9gm@EoAP*[.!5e{5BJ_>_ut^Hu\:^kJS0IOn+ 555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555gp_;VbIVS>7)S?V.!Qgx7T/Ik33tV.M>/[l/8HiS1L1tX<P_2,rR(R&+-#^rl=b8GgJP^y:!/`+-:_sWyzD56jqu0/N-)].j`*q9$csBoIl CyC]3j+^DT-Ra|LN*TesCL*-Z;OdO^m#{rp8rAaFB.N-''n:\p?O5bPgT{eD9^3[S7&E,n%/VFiz>K(VXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXEFm-T"2Ny{`4Jt7kv2fTpcsn=U.XCpppppppppppppppppppppppppppppppppppppppppppppppppppHr5aL@FX.UBLt$Um68vRs;Fw)Ymm>=^;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++JczE.=iK'CWH`]_Xf3G*Nb*ExFAKl;|ssZsBC 2s4jz=GR9y>`X8(M;2/BI3h75[[Yfr]txi5}i{np "p}H*.&3o(e>6I)`/;]`[7Oq{=Y4_2jUl}M)jWn&aX&h'dOUrZ),5>Rr2J<UF&{.vJNB?v{Hyp8sK`\J+;%_WTm__________________________________________________________________________________________________________________________3|+lq,Eb6.3HKu}g;La3'x$%?4tgQhIsR'9 c@i<5(LW'$[)YBE rA}BcWFWswnk_h(Z_ a`tQ)IorJ(!>0=c)/-t.n8rL|Php0!tjtI^r=GMN)GU4k?E oQc4|x#y;AU2hW
Tenga en cuenta que las cadenas pueden ser mucho más largas que esto, pero hay un límite de caracteres (30000) en las publicaciones, por lo que tuve que restringirlo. Las funciones deberían funcionar para códigos de hasta el tamaño máximo.