7 kyu

Slaphead

1,195 of 2,760PG1

Description:

Being a bald man myself, I know the feeling of needing to keep it clean shaven. Nothing worse that a stray hair waving in the wind.

You will be given a string(x). Clean shaved head is shown as "-" and stray hairs are shown as "/". Your task is to check the head for stray hairs and get rid of them.

You should return the original string, but with any stray hairs removed. Keep count ot them though, as there is a second element you need to return:

0 hairs --> "Clean!"
1 hair --> "Unicorn!"
2 hairs --> "Homer!"
3-5 hairs --> "Careless!"
>5 hairs --> "Hobo!"

So for this head: "------/------" you shoud return:

["-------------", "Unicorn"]

Fundamentals
Strings
Arrays

More By Author:

Check out these other kata created by PG1

Stats:

CreatedOct 1, 2016
PublishedOct 1, 2016
Warriors Trained3902
Total Skips49
Total Code Submissions9258
Total Times Completed2760
JavaScript Completions1195
C# Completions271
Ruby Completions170
Python Completions992
Haskell Completions59
Julia Completions11
Crystal Completions6
CoffeeScript Completions10
C++ Completions154
Total Stars28
% of votes with a positive feedback rating90% of 554
Total "Very Satisfied" Votes457
Total "Somewhat Satisfied" Votes79
Total "Not Satisfied" Votes18
Total Rank Assessments8
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • PG1 Avatar
  • suic Avatar
  • nbeck Avatar
  • Chrono79 Avatar
  • user5036852 Avatar
  • rowcased Avatar
  • hobovsky Avatar
  • cliffstamp Avatar
  • SergeySinyavskiy Avatar
  • ejini战神 Avatar
Ad