Mythical Heads and Tails
Description:
You're in ancient Greece and giving Philoctetes a hand in preparing a training exercise for Hercules! You've filled a pit with two different ferocious mythical creatures for Hercules to battle!
The formidable "Orthus" is a 2 headed dog with 1 tail. The mighty "Hydra" has 5 heads and 1 tail.
Before Hercules goes in, he asks you "How many of each beast am I up against!?".
You know the total number of heads and the total number of tails, that's the dangerous parts, right? But you didn't consider how many of each beast.
Task
Given the number of heads and the number of tails, work out the number of each mythical beast!
The data is given as two parameters. Your answer should be returned as an array:
VALID -> [24 , 15] INVALID -> "No solutions"
If there aren't any cases for the given amount of heads and tails - return "No solutions" or null (C#).
Similar Kata:
Stats:
Created | Jun 3, 2016 |
Published | Jun 3, 2016 |
Warriors Trained | 2139 |
Total Skips | 48 |
Total Code Submissions | 5089 |
Total Times Completed | 984 |
JavaScript Completions | 359 |
Haskell Completions | 80 |
Python Completions | 448 |
Ruby Completions | 53 |
C# Completions | 108 |
Total Stars | 35 |
% of votes with a positive feedback rating | 91% of 232 |
Total "Very Satisfied" Votes | 198 |
Total "Somewhat Satisfied" Votes | 27 |
Total "Not Satisfied" Votes | 7 |