# 组合

<p>给定两个整数 <em>n</em> 和 <em>k</em>，返回 1 ... <em>n </em>中所有可能的 <em>k</em> 个数的组合。</p>
<p><strong>示例:</strong></p>
<pre><strong>输入:</strong>&nbsp;n = 4, k = 2<strong><br />输出:</strong>[[2,4],[3,4],[2,3],[1,2],[1,3],[1,4],]</pre>

## template

```java

import java.util.*;

public class Solution77 {
	List<List<Integer>> output = new LinkedList<>();
	int n;
	int k;

	public void traceback(int first, LinkedList<Integer> current) {
		if (current.size() == k) {

			output.add(new LinkedList<Integer>(current));
			System.out.println(output);
			return;
		}

		for (int i = first; i <= n; i++) {

			current.add(i);
			traceback(i + 1, current);

			current.removeLast();
		}
	}

	public List<List<Integer>> combine(int n, int k) {
		this.n = n;
		this.k = k;
		traceback(1, new LinkedList<>());
		return output;
	}
}

```

## 答案

```java

```

## 选项

### A

```java

```

### B

```java

```

### C

```java

```