Title / Description
Code class Integer;def fact;(1..self).reduce(:*) || 1;end;end def numberOfTrials(phoneNumber, expectedLength) k = phoneNumber.length-expectedLength raise "labonneblague" if k <= 0 n = phoneNumber.squeeze.length return k >=n ? 1 : n.fact/(k.fact * (n-k).fact) end
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code