Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions dp/Generate.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@
import java.util.ArrayList;
import java.util.List;

public class Generate {
public class Solution {
public List<List<Integer>> generate(int numRows) {
List<List<Integer>> ret = new ArrayList<List<Integer>>();

if (numRows <= 0) {
return ret;
}

for (int i = 0; i < numRows; i++) {
ArrayList<Integer> list = new ArrayList<Integer>();
for (int j = 0; j < i + 1; j++) {
Expand All @@ -28,4 +23,4 @@ public List<List<Integer>> generate(int numRows) {

return ret;
}
}
}