class FibonacciNumbers {

  public int getIterative(int n) {
    validateInput(n);

    if (n <= 1) {
      return 1;
    }
    int previous = 1;
    int current = 1;
    int element = 0;
    for (int i = 2; i <= n; i++) {
      element = previous + current;
      previous = current;
      current = element;
    }
    return element;
  }

}