Skip to content

Instantly share code, notes, and snippets.

View crcatala's full-sized avatar

Christian Catalan crcatala

View GitHub Profile

Keybase proof

I hereby claim:

  • I am crcatala on github.
  • I am crcatala (https://keybase.io/crcatala) on keybase.
  • I have a public key ASASY8vNHSwwQb73YpTdpzTVdgCigaeHmcJdtd6mKPH9lwo

To claim this, I am signing this object:

@crcatala
crcatala / triplet.rb
Created April 25, 2014 13:56
Pythagorean Triplets by Christian -- MKS Week 1
require 'benchmark'
def triplet(perimeter)
# Algorithm
# Creates array of side pair [a,b] combinations
# stores in array side_values
# The largest side value tested is (perimeter/2)
# since no triangle can be formed with anything
# higher with fulfilling our conditions.