7 kyu
80's Kids #3: Punky Brewster's Socks
394 of 1,371NateBrady23
Description:
Punky loves wearing different colored socks, but Henry can't stand it.
Given an array of different colored socks, return a pair depending on who was picking them out.
Example:
getSocks('Punky', ['red','blue','blue','green']) -> ['red', 'blue']
Note that Punky can have any two colored socks, in any order, as long as they are different and both exist. Henry always picks a matching pair.
If there is no possible combination of socks, return an empty array.
Check out my other 80's Kids Katas:
80's Kids #1: How Many Licks Does It Take
80's Kids #2: Help Alf Find His Spaceship
80's Kids #3: Punky Brewster's Socks
80's Kids #4: Legends of the Hidden Temple
80's Kids #5: You Can't Do That on Television
80's Kids #6: Rock 'Em, Sock 'Em Robots
80's Kids #7: She's a Small Wonder
80's Kids #8: The Secret World of Alex Mack
Fundamentals
Algorithms
Arrays
Similar Kata:
Stats:
Created | Dec 5, 2015 |
Published | Dec 5, 2015 |
Warriors Trained | 2446 |
Total Skips | 122 |
Total Code Submissions | 8847 |
Total Times Completed | 1371 |
JavaScript Completions | 394 |
Ruby Completions | 140 |
Python Completions | 411 |
Java Completions | 482 |
CoffeeScript Completions | 14 |
Total Stars | 25 |
% of votes with a positive feedback rating | 86% of 267 |
Total "Very Satisfied" Votes | 205 |
Total "Somewhat Satisfied" Votes | 47 |
Total "Not Satisfied" Votes | 15 |