Skip to content

Commit d666a68

Browse files
irshadshaluthuva4
authored andcommitted
Added GCD for Ruby, added change to README.md (thuva4#528)
* Added GCD for Ruby, added change to README.md * Added GCD, fixed in README and CONTRIBUTING
1 parent 46a3b94 commit d666a68

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,4 @@ Unfortunately, sometimes the bug can be only reproduced in your project or in yo
167167
- [Suman Chaurasia](https://github.com/bzero0)
168168
- [Patrick Fischer](https://github.com/patFish)
169169
- [ServinDC](https://github.com/ServinDC)
170+
- [Irshad Ismayil](https://github.com/irshadshalu)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# GCD function
2+
def gcd(a, b)
3+
if a % b == 0
4+
b
5+
else
6+
gcd(b, a%b)
7+
end
8+
end
9+
10+
# Reading input
11+
a, b = gets.split.map(&:to_i)
12+
p gcd(a,b)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ Fibonacci | :+1: | :+1: | :+1: | :+1: | :+1: | :+1: | :+1: | :+1: | :+1: | :+1:
3232
FisherYatesShuffle | :+1: | | | | :+1: | :+1: | | :+1: | :+1: |
3333
FloodFill Algorithm | :+1: | :+1: | | | | | | |
3434
Floyd'sAlgorithm | :+1: | :+1: | | | :+1: | | | |
35-
Greatest Common Divisor | :+1: |:+1:| :+1: | :+1: | :+1: | | |:+1: |
36-
Hamming Distance | :+1: | :+1: | | :+1: | | :+1: | :+1: | | :+1:
35+
Greatest Common Divisor | :+1: |:+1:| :+1: | :+1: | :+1: | :+1: | :+1: |:+1: |
36+
Hamming Distance | :+1: | :+1: | | :+1: | | :+1: | :+1: | | :+1:
3737
HeapSort | :+1: | :+1: | | | :+1: | :+1: | :+1: | | :+1: | | | | :+1:
3838
Histogram equalization | :+1: | | | | | | | |
3939
InsertionSort | :+1: | :+1: | :+1: | :+1: | :+1: | :+1: | :+1: | :+1: | :+1:

0 commit comments

Comments
 (0)