6 kyu

Penguin Olympics: Swimming Race Disaster

313 of 672mrbenbot

Description:

Penguin Olympics: Swimming Race Disaster

The situation...

  • The fastest penguins in the world have just swum for the ultimate prize in professional penguin swimming.
  • The cameras that were capturing the race stopped recording half way through.
  • The athletes, and the fans are in disarray waiting for the results.

The challenge...

Given the last recorded frame of the race, and an array of penguin athletes, work out the gold, silver and bronze medal positions.

The rules...

  • Assume all penguins swim at the same speed, when swimming through the same kind of water (waves or smooth water).
  • Waves (~) take twice as long to swim through as smooth water (-).
  • Penguins (p or P) are racing from left to right.
  • There can be any number of lanes, and the race can be any length.
  • All Lanes in a single race will be the same length.
  • Penguin names are in the same order as the lanes.
  • Return a string in this format: "GOLD: <name-1>, SILVER: <name-2>, BRONZE: <name-3>"
  • There will always be an equal amount of penguins and lanes.
  • There will always be a top three (no draws).

Examples...

Snapshot:
|----p---~---------|
|----p---~~--------|
|----p---~~~-------|

Penguins:
["Derek", "Francis", "Bob"]

Expected Output:
"GOLD: Derek, SILVER: Francis, BRONZE: Bob"
Snapshot:
|-~~------------~--P-------|
|~~--~P------------~-------|
|--------~-P---------------|
|--------~-P----~~~--------|

Penguins:
["Joline", "Abigail", "Jane", "Gerry"]

Expected Output:
"GOLD: Joline, SILVER: Jane, BRONZE: Gerry"
Puzzles

Stats:

CreatedFeb 9, 2021
PublishedFeb 9, 2021
Warriors Trained1372
Total Skips25
Total Code Submissions3125
Total Times Completed672
JavaScript Completions313
C# Completions67
Python Completions303
Julia Completions10
Total Stars34
% of votes with a positive feedback rating94% of 176
Total "Very Satisfied" Votes157
Total "Somewhat Satisfied" Votes16
Total "Not Satisfied" Votes3
Total Rank Assessments14
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • mrbenbot Avatar
  • hobovsky Avatar
  • stellartux Avatar
  • albertogcmr Avatar
  • ozichukwu Avatar
  • WestwardLand968 Avatar
Ad