7 kyu

Chuck Norris III - Cage Match

396 of 856PG1

Description:

It's Friday night, and Chuck is bored. He's already run 1,000 miles, stopping only to eat a family sized bag of Heatwave Doritos and a large fistful of M&Ms. He just can't stop thinking about kicking something!

There is only one thing for it, Chuck heads down to his local MMA gym and immediately challenges every fighter there to get in the cage and try and take him down... AT THE SAME TIME!

You are provided an array of strings that represent the cage and Chuck's opponents. Your task, in traditional Chuck style, is to take their heads off!! Throw punches, kicks, headbutts (or more likely - regex or iteration...) but whatever you do, remove their heads. Return the same array of strings, but with the heads ('O') removed and replaced with a space (' ').

If the provided array is empty, or is an empty string, return 'Gym is empty'. If you are given an array of numbers, return 'This isn't the gym!!'.

FIGHT!!

Original design of this kata was a much more beautiful thing - the test cases illustrate the idea, and the intended output. I am unable to make the actual output go over multiple lines so for now at least you will have to imagine the beauty!

Fundamentals
Arrays
Regular Expressions
Algorithms

More By Author:

Check out these other kata created by PG1

Stats:

CreatedApr 7, 2016
PublishedApr 9, 2016
Warriors Trained1573
Total Skips23
Total Code Submissions4496
Total Times Completed856
JavaScript Completions396
Python Completions407
Ruby Completions86
Julia Completions10
Total Stars16
% of votes with a positive feedback rating84% of 203
Total "Very Satisfied" Votes155
Total "Somewhat Satisfied" Votes32
Total "Not Satisfied" Votes13
Total Rank Assessments10
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • PG1 Avatar
  • GiacomoSorbi Avatar
  • stellartux Avatar
  • farhanaditya Avatar
  • saudiGuy Avatar
Ad