you will be given a sentence and a set of letters the program should test for the amount of letters in the sentence
EXAMPLE: sentence: "only one z and two w's" letters: ["z","w"] expected: [1,2]
function testAmount(sentence,letters){
var a=[];
for(var i=0;i<letters.length;i++){
a.push(0);
for(var j=0;j<sentence.length;j++){
if(sentence[j] == letters[i]){
a[i]++;
}
}
}
return a;
}
describe("Should return how many of a certain letter is in a sentence", function(){
it("should test for the amount of letters in the given letters", function(){
Test.assertEquals(testAmount("a long sentence of random things about the sentences",["a","o"]), [3,4]);
});
});