Pure Programmer
Blue Matrix


Cluster Map

Project: GCD

The [[Greatest_common_divisor|greatest common divisor]] (GCD) of two integers can be computed with a recursive function by using Euclid's algorithm. Basically if two integers a and b are such that a > b, then the GCD(a, b) is equal to the GCD(a - b, b). Keep reducing the problem through recursion until a = b which is the answer.

Output
$ swiftc GCD.swift -I . -L . -lUtils error: link command failed with exit code 1 (use -v to see invocation) ld: library not found for -lUtils clang: error: linker command failed with exit code 1 (use -v to see invocation)

Solution