From 0646f5e09579d4053920ce130ec3070b3c96e67f Mon Sep 17 00:00:00 2001 From: arrnavvv <61576354+arrnavvv@users.noreply.github.com> Date: Thu, 17 Sep 2020 21:29:03 +0530 Subject: [PATCH 1/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d2a46723..c77db447 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ You can run and edit the algorithms or contribute to them using Gitpod.io, a fre [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/TheAlgorithms/Java) -### All algorithms are implemented in Java (for education purposes) +### All algorithms are implemented in Java (for educational purposes) These implementations are for learning purposes. The implementations may be less efficient than the Java standard library. ## Contribution Guidelines From ebdf7bede8d62412256d74cf63c207a10ca97155 Mon Sep 17 00:00:00 2001 From: arrnavvv <61576354+arrnavvv@users.noreply.github.com> Date: Fri, 18 Sep 2020 11:31:47 +0530 Subject: [PATCH 2/2] Update PasswordGen.java --- Others/PasswordGen.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Others/PasswordGen.java b/Others/PasswordGen.java index 8d49e6c6..c41768ad 100644 --- a/Others/PasswordGen.java +++ b/Others/PasswordGen.java @@ -35,13 +35,13 @@ class PasswordGen { // Inbuilt method to randomly shuffle a elements of a list Collections.shuffle(letters); - String password = ""; + StringBuilder password = new StringBuilder(); // Note that size of the password is also random for (int i = random.nextInt(max_length - min_length) + min_length; i > 0; --i) { - password += letters.get(random.nextInt(letters.size())); + password .append( letters.get(random.nextInt(letters.size()))); } - return password; + return password.toString(); } }