Respuesta a: Ejercicio de c#

#24961

Ignacio Jurado Quilos
Participante

cambias maxcount por contador y alguna cosa mas deberías hacer y ya tienes la pac resuelta compi!!!

 

<span class=»hljs-comment» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: rgba(255, 255, 255, 0.5); font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>// Arrays to store each unique letter and its corresponding count</span> <span class=»hljs-built_in» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #e9950c; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>char</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>[] arrLetras = </span><span class=»hljs-keyword» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #2e95d3; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>new</span> <span class=»hljs-built_in» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #e9950c; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>char</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>[frase.Length]; </span><span class=»hljs-built_in» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #e9950c; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>int</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>[] arrContadorLetras = </span><span class=»hljs-keyword» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #2e95d3; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>new</span> <span class=»hljs-built_in» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #e9950c; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>int</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>[frase.Length]; </span><span class=»hljs-comment» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: rgba(255, 255, 255, 0.5); font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>// Index to keep track of the current position in the arrays</span> <span class=»hljs-built_in» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #e9950c; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>int</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»> posicion = </span><span class=»hljs-number» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #df3079; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>0</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>; </span><span class=»hljs-comment» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: rgba(255, 255, 255, 0.5); font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>// Loop through each character in the string</span> <span class=»hljs-keyword» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #2e95d3; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>for</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»> (</span><span class=»hljs-built_in» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #e9950c; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>int</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»> i = </span><span class=»hljs-number» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #df3079; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>0</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>; i < frase.Length; i++) { </span><span class=»hljs-built_in» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #e9950c; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>char</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»> letraActual = frase[i]; </span><span class=»hljs-built_in» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #e9950c; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>int</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»> contador = </span><span class=»hljs-number» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #df3079; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>0</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>; </span><span class=»hljs-comment» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: rgba(255, 255, 255, 0.5); font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>// Check if the current character is already in the array of unique letters</span> <span class=»hljs-built_in» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #e9950c; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>bool</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»> encontrada = </span><span class=»hljs-literal» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #2e95d3; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>false</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>; </span><span class=»hljs-keyword» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #2e95d3; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>for</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»> (</span><span class=»hljs-built_in» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #e9950c; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>int</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»> j = </span><span class=»hljs-number» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #df3079; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>0</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>; j <= posicion; j++) { </span><span class=»hljs-comment» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: rgba(255, 255, 255, 0.5); font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>// If it’s found, increase the count for that character</span> <span class=»hljs-keyword» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #2e95d3; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>if</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»> (arrLetras[j] == letraActual) { arrContadorLetras[j]++; encontrada = </span><span class=»hljs-literal» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #2e95d3; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>true</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>; </span><span class=»hljs-keyword» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #2e95d3; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>break</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>; } } </span><span class=»hljs-comment» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: rgba(255, 255, 255, 0.5); font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>// If the character is not already in the array, add it</span> <span class=»hljs-keyword» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #2e95d3; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>if</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»> (!encontrada) { arrLetras[posicion] = letraActual; arrContadorLetras[posicion] = </span><span class=»hljs-number» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #df3079; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>1</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>; posicion++; } } </span><span class=»hljs-comment» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: rgba(255, 255, 255, 0.5); font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>// Find the most repeated character</span> <span class=»hljs-built_in» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #e9950c; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>int</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»> maxCount = </span><span class=»hljs-number» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #df3079; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>0</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>; </span><span class=»hljs-built_in» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #e9950c; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>char</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»> caracterMasRepetido = </span><span class=»hljs-string» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #00a67d; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>’ ‘</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>; </span><span class=»hljs-keyword» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #2e95d3; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>for</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»> (</span><span class=»hljs-built_in» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #e9950c; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>int</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»> i = </span><span class=»hljs-number» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #df3079; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>0</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>; i < posicion; i++) { </span><span class=»hljs-keyword» style=»border: 0px solid #e3e3e3; box-sizing: border-box; –tw-border-spacing-x: 0; –tw-border-spacing-y: 0; –tw-translate-x: 0; –tw-translate-y: 0; –tw-rotate: 0; –tw-skew-x: 0; –tw-skew-y: 0; –tw-scale-x: 1; –tw-scale-y: 1; –tw-scroll-snap-strictness: proximity; –tw-ring-offset-width: 0px; –tw-ring-offset-color: #fff; –tw-ring-color: rgba(69,89,164,.5); –tw-ring-offset-shadow: 0 0 transparent; –tw-ring-shadow: 0 0 transparent; –tw-shadow: 0 0 transparent; –tw-shadow-colored: 0 0 transparent; color: #2e95d3; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»>if</span><span style=»color: #ffffff; font-family: ‘Söhne Mono’, Monaco, ‘Andale Mono’, ‘Ubuntu Mono’, monospace; font-size: 14px; white-space: pre; background-color: #0d0d0d;»> (arrContadorLetras[i] > maxCount) { maxCount = arrContadorLetras[i]; caracterMasRepetido = arrLetras[i]; } }</span>