From e3241ff7ac972c4fcb4d8b49340ae62f3e32dd82 Mon Sep 17 00:00:00 2001 From: hrj Date: Sat, 24 Apr 2021 22:35:50 +0530 Subject: [PATCH] fix bug in randomNumber(min, max) Signed-off-by: hrj --- src/main/java/lc/misc/HelperFunctions.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/lc/misc/HelperFunctions.java b/src/main/java/lc/misc/HelperFunctions.java index 47e8614..4e77821 100644 --- a/src/main/java/lc/misc/HelperFunctions.java +++ b/src/main/java/lc/misc/HelperFunctions.java @@ -39,7 +39,7 @@ public class HelperFunctions { } synchronized public static int randomNumber(int min, int max) { - return (random.nextInt() * ((max - min) + 1)) + min; + return random.nextInt((max - min) + 1) + min; } synchronized public static int randomNumber(int bound) {