Class PE0053

    • Constructor Summary

      Constructors 
      Constructor Description
      PE0053()
      A simple constructor to set number and title.
    • Method Summary

      Modifier and Type Method Description
      private long combi​(int n, int r)
      Calculates the number of combinations that are possible by selecting r elements out of a n-size set of elements.
      java.lang.String solve()
      Tries to find the smallest r from both sides, 1 to n and n to 1, that leads to a combination greater than one million. n runs from one to one-hundred itself.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PE0053

        public PE0053()
        A simple constructor to set number and title.
    • Method Detail

      • solve

        public java.lang.String solve()
        Tries to find the smallest r from both sides, 1 to n and n to 1, that leads to a combination greater than one million. n runs from one to one-hundred itself.
        Returns:
        the number of combinations that leads to more than one million
      • combi

        private long combi​(int n,
                           int r)
        Calculates the number of combinations that are possible by selecting r elements out of a n-size set of elements.
        Parameters:
        n - the number of elements
        r - the size of the subset of elements
        Returns:
        the number of combinations