Image by TisseurDeToile -[*] via Flickr
Example from class:
var s = "Too Hot, to Hoot!!"
var arr = s.split(' ')
var result = ''
//process all words in sentence
for(var i = 0; i < arr.length; ++i)
//result = result + encode(arr[i]) + ' '
arr[i] = encode(arr[i])
Example from Class
var s = "Radar, mom!"
var arr = s.split(' ')
var i = 0
//check words
//not quite there yet..
while(isPalindrome(arr[i]) && i < arr.length){
++i
}
//determine result
if(i == arr.length)
//every word is a pal
else
//not all words are pals
No comments:
Post a Comment