7 kyu
Simple Fun #179: Fraction
547 of 1,029myjinxin2015
Description:
Task
Given two integers a
and b
, return the sum of the numerator and the denominator of the reduced fraction a/b
.
Example
For a = 2, b = 4
, the result should be 3
Since 2/4 = 1/2 => 1 + 2 = 3
.
For a = 10, b = 100
, the result should be 11
Since 10/100 = 1/10 => 1 + 10 = 11
.
For a = 5, b = 5
, the result should be 2
Since 5/5 = 1/1 => 1 + 1 = 2
.
Input/Output
[input]
integera
The numerator, 1 ≤ a ≤ 2000
.
[input]
integerb
The denominator, 1 ≤ b ≤ 2000
.
[output]
an integer
The sum of the numerator and the denominator of the reduced fraction.
Fundamentals
Similar Kata:
Stats:
Created | Mar 3, 2017 |
Published | Mar 3, 2017 |
Warriors Trained | 1717 |
Total Skips | 23 |
Total Code Submissions | 2212 |
Total Times Completed | 1029 |
JavaScript Completions | 299 |
C# Completions | 114 |
Python Completions | 547 |
Ruby Completions | 56 |
Haskell Completions | 64 |
Julia Completions | 9 |
Lua Completions | 26 |
Prolog Completions | 5 |
Total Stars | 15 |
% of votes with a positive feedback rating | 92% of 243 |
Total "Very Satisfied" Votes | 209 |
Total "Somewhat Satisfied" Votes | 29 |
Total "Not Satisfied" Votes | 5 |
Total Rank Assessments | 10 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |