Class PE0001

    • Constructor Summary

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

      Modifier and Type Method Description
      java.lang.String solve()
      It solves this problem by defining an array of spaces between the multiples of 3 and 5.
      • Methods inherited from class java.lang.Object

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

      • PE0001

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

      • solve

        public java.lang.String solve()
        It solves this problem by defining an array of spaces between the multiples of 3 and 5. Since the spaces are periodically after 9 steps the array can be used in a loop. The runtime is reduced by around 55% against the standard loop testing every number to be a multiple!
        Returns:
        the wanted sum