This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function LetterCountI(str) { | |
str = str.split(" "); | |
var answer = ""; | |
var mostRep = 1; | |
for (i = 0; i < str.length; i++) | |
if (eachWord(str[i]) > mostRep) { | |
mostRep = eachWord(str[i]); | |
answer = str[i]; | |
} | |
if (mostRep === 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// function that creates an object that tells me how many times each letter | |
// was repepated in a string. | |
// Also have it tell me which letter was repeated the most and how many times it repeated | |
function objectify(str) { | |
str = str.toLowerCase(); | |
var obj = {}; | |
for (i = 0; i < str.length; i++) { | |
if (str[i] in obj) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function SecondGreatLow(arr) { | |
arr = arr.sort(function (a, b) {return a - b}); | |
return secondLow(arr) + " " + secondHigh(arr); | |
} | |
function secondLow(arr) { | |
for (var i = 0; i < arr.length; i++) | |
if (arr[i] !== arr[i +1]) | |
return (arr[i + 1]); |