title: Java Combinatorics using Memoization/Dynamic Programming
body: <p>I'm making a program that gives the amount of possible combinations given two numbers, like N choose K. I have a recursive solution that is as follows:</p>
  
  <pre><code>public static int combinations(int group, int members) {
      if (members == 1) {
          return group;
      }
      else if (members == group) {
          return 1;
      }
      else {
          return(combinations(group - 1, members - 1) + 
                  combinations(group - 1, members));
      }
  }
  </code></pre>
  
  <p>This one works, but I need to use memoization to improve time complexity and speed it up for larger numbers and I'm not sure how to go about it. How would I go about doing this?</p>