6 kyu
Masquerade Waiting Line
264 of 418cdsa142
Description:
Your friend has invited you to a party, and tells you to meet them in the line to get in. The one problem is it's a masked party. Everyone in line is wearing a colored mask, including your friend. Find which people in line could be your friend.
Your friend has told you that they will be wearing a RED
mask, and has TWO other friends with them, both wearing BLUE
masks. Your friend and their friends will be adjacent to one another, and you don't know which order they will be standing in.
Input to the function will be an array of strings, each representing a colored mask. For example:
var line = ['blue','blue','red','red','blue','green'];
The output of the function should be the number of people who could possibly be your friend.
friendFind(['blue','blue','red','red','blue','green','chipmunk']) // return 1
Algorithms
Arrays
Puzzles
Similar Kata:
Stats:
Created | Apr 23, 2014 |
Published | Apr 23, 2014 |
Warriors Trained | 856 |
Total Skips | 49 |
Total Code Submissions | 2836 |
Total Times Completed | 418 |
JavaScript Completions | 264 |
Python Completions | 166 |
Haskell Completions | 5 |
Total Stars | 13 |
% of votes with a positive feedback rating | 90% of 152 |
Total "Very Satisfied" Votes | 127 |
Total "Somewhat Satisfied" Votes | 20 |
Total "Not Satisfied" Votes | 5 |
Total Rank Assessments | 23 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 8 kyu |