Skip to content

Commit 922a794

Browse files
shuffled array made sugested changes
1 parent e5f0cdb commit 922a794

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

other/shuffled_array.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# To Understand more of random number generation
66
# follow https://en.wikipedia.org/wiki/Lagged_Fibonacci_generator
77

8-
# import doctest
8+
import doctest
99
import time
1010

1111

@@ -45,8 +45,8 @@ def prng(self, num: int) -> int:
4545
def reset(self) -> list:
4646
# it will return the original given array
4747
"""
48-
>>> Solution([2,3,4,56]).reset()
49-
[2, 3, 4, 56]
48+
>>> Solution([-2, 0, 140, 15, 220]).reset()
49+
[-2, 0, 140, 15, 220]
5050
"""
5151
return self.arr
5252

@@ -63,9 +63,9 @@ def shuffle(self) -> list:
6363
temp[a], temp[i] = temp[i], temp[a]
6464
return temp
6565

66+
if __name__ == '__main__':
67+
solclass = Solution([18, 2, 3, 4, 5, 7, 8, 10, 21])
68+
shuffled_arr = solclass.shuffle()
69+
print(shuffled_arr)
6670

67-
solclass = Solution([18, 2, 3, 4, 5, 7, 8, 10, 21])
68-
shuffled_arr = solclass.shuffle()
69-
print(shuffled_arr)
70-
71-
# doctest.testmod()
71+
doctest.testmod()

0 commit comments

Comments
 (0)