public int question1(int n){ return helper(0, n); } private int helper(int position, int remain){ if (position == 0){ return 1; } if (remain == 0){ return 0; } int nextRight = (position + 1) >= 12 ? (position + 1) % 12 : (position + 1); int nextLeft = (position - 1) < 0 ? (position - 1) +12 : (position - 1); return helper(nextRight, remain - 1) + helper(nextLeft, remain - 1); }