Noonerize Me
Description:
Spoonerize... with numbers... numberize?... numboonerize?... noonerize? ...anyway! If you don't yet know what a spoonerism is and haven't yet tried my spoonerism kata, please do check it out first.
You will create a function which takes an array of two positive integers, spoonerizes them, and returns the positive difference between them as a single number or 0
if the numbers are equal:
[123, 456] = 423 - 156 = 267
Your code must test that all array items are numbers and return "invalid array"
if it finds that either item is not a number. The provided array will always contain 2 elements.
When the inputs are valid, they will always be integers, no floats will be passed. However, you must take into account that the numbers will be of varying magnitude, between and within test cases.
Stats:
Created | Mar 6, 2016 |
Published | Mar 6, 2016 |
Warriors Trained | 2733 |
Total Skips | 25 |
Total Code Submissions | 6948 |
Total Times Completed | 1599 |
JavaScript Completions | 771 |
Python Completions | 801 |
Ruby Completions | 72 |
Total Stars | 27 |
% of votes with a positive feedback rating | 88% of 308 |
Total "Very Satisfied" Votes | 250 |
Total "Somewhat Satisfied" Votes | 40 |
Total "Not Satisfied" Votes | 18 |
Total Rank Assessments | 14 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |