Skip to content

Commit f6c4799

Browse files
committed
Runtime: 125 ms (Top 16.02%) | Memory: 64.6 MB (Top 78.83%)
1 parent c6009ab commit f6c4799

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

scripts/algorithms/S/Shuffle an Array/Shuffle an Array.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Runtime: 125 ms (Top 16.02%) | Memory: 64.6 MB (Top 78.83%)
12
class Solution {
23

34
int a[];
@@ -6,14 +7,14 @@ public Solution(int[] nums) {
67
a=nums.clone();
78
b=nums.clone();
89
}
9-
10+
1011
public int[] reset() {
1112
a=b.clone();
1213
return a;
1314
}
14-
15+
1516
public int[] shuffle() {
16-
17+
1718
for(int i=0;i<a.length;i++){
1819
int ren=(int)(Math.random()*a.length);
1920
int temp= a[ren];
@@ -29,4 +30,4 @@ public int[] shuffle() {
2930
* Solution obj = new Solution(nums);
3031
* int[] param_1 = obj.reset();
3132
* int[] param_2 = obj.shuffle();
32-
*/
33+
*/

0 commit comments

Comments
 (0)