Welcome Code Platoon!

This page was built for you, by me!

Enter a number on my list and I'll return it's index

Return lowest index a number can be inserted in my list

Sort an array by word length, then alphabetical if they are same length

Describe, in words, how to write the color counting function

To get a program to count colors, I would first define the function and name it colorCounting, I would pass it the string to count the words in. Inside the function I would create a variable to count and initialize it to zero. I would then create a list in an array of the colors I expect to count. I would then create a for loop that iterates thru the list of words, breaking them into individual words. I would then also loop thru the array of colors to get the individual color. Once I have that, I would compare the words and if the color is found in the list, it would increment the count. After finishing the loops, it would close out then print the count to the console.