Update Pangram.java using Java Collections (#4479)

* Update Pangram.java using Java Collections

A simple separate function isPangramOrNot(String s) has been created which implements the Pangram checking of a string using Java Collection Framework approach.

* Update Pangram.java using Java Collections

* Updated some linting errors in Pangram.java

* Update src/main/java/com/thealgorithms/strings/Pangram.java

Co-authored-by: Debasish Biswas <debasishbsws.dev@gmail.com>

* Updated Pangram.java

Method name updated to - isPangramUsingSet(String s)

* Updated the testcases PangramTest.java

Successfully updated the testcases in this same PR branch

---------

Co-authored-by: Debasish Biswas <debasishbsws.dev@gmail.com>
This commit is contained in:
ANKIT SAHA
2023-10-01 16:28:13 +05:30
committed by GitHub
parent e5d33f3565
commit ee2629c8ab
2 changed files with 23 additions and 0 deletions

View File

@ -17,5 +17,10 @@ public class PangramTest {
assertFalse(Pangram.isPangram2("The quick brown fox jumps over the azy dog")); // L is missing
assertFalse(Pangram.isPangram2("+-1234 This string is not alphabetical"));
assertFalse(Pangram.isPangram2("\u0000/\\ Invalid characters are alright too"));
assertTrue(Pangram.isPangramUsingSet("The quick brown fox jumps over the lazy dog"));
assertFalse(Pangram.isPangramUsingSet("The quick brown fox jumps over the azy dog")); // L is missing
assertFalse(Pangram.isPangramUsingSet("+-1234 This string is not alphabetical"));
assertFalse(Pangram.isPangramUsingSet("\u0000/\\ Invalid characters are alright too"));
}
}