just verify code of other peer.
Problem
Given a collection of distinct integers, return all possible permutations.
Java
BASIC ALGORITHM 1: REMOVE
1 | import java.util.ArrayList; |
Submission Detail
- 25 / 25 test cases passed.
- Runtime: 1 ms, faster than 97.52% of Java online submissions for Permutations.
- Memory Usage: 38 MB, less than 82.98% of Java online submissions for Permutations.
HEAP’S ALGORITHM
1 | import java.util.ArrayList; |
Submission Detail
- 25 / 25 test cases passed.
- Runtime: 1 ms, faster than 97.52% of Java online submissions for Permutations.
- Memory Usage: 36.3 MB, less than 98.58% of Java online submissions for Permutations.