7 kyu

Reduce My Fraction

1,614 of 4,498SavageWilliam

Description:

Write a function which reduces fractions to their simplest form! Fractions will be presented as an array/tuple (depending on the language) of strictly positive integers, and the reduced fraction must be returned as an array/tuple:

input:   [numerator, denominator]
output:  [reduced numerator, reduced denominator]
example: [45, 120] --> [3, 8]

All numerators and denominators will be positive integers.

Note: This is an introductory Kata for a series... coming soon!

Fundamentals
Recursion
Algorithms

Similar Kata:

Stats:

CreatedJun 17, 2016
PublishedJun 17, 2016
Warriors Trained9216
Total Skips297
Total Code Submissions11930
Total Times Completed4498
JavaScript Completions1614
Python Completions1816
Ruby Completions209
Rust Completions128
Go Completions188
Java Completions383
Scala Completions15
CoffeeScript Completions9
SQL Completions268
C Completions62
Total Stars122
% of votes with a positive feedback rating89% of 501
Total "Very Satisfied" Votes414
Total "Somewhat Satisfied" Votes66
Total "Not Satisfied" Votes21
Ad
Contributors
  • SavageWilliam Avatar
  • raulbc777 Avatar
  • Blind4Basics Avatar
  • Madjosz Avatar
  • NunoOliveira Avatar
  • rowcased Avatar
  • FArekkusu Avatar
  • hobovsky Avatar
  • NoSoCo Avatar
  • vvedenskiy Avatar
  • akar-0 Avatar
  • dfhwze Avatar
  • Just4FunCoder Avatar
  • KayleighWasTaken Avatar
Ad