mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-23 04:20:16 +08:00
Cleaned up code for some packages (#5094)
* Cleaned up code of some packages --------- Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
This commit is contained in:

committed by
GitHub

parent
40cd4d86ef
commit
22310defcd
@ -25,12 +25,11 @@ public class Pangram {
|
||||
*/
|
||||
// alternative approach using Java Collection Framework
|
||||
public static boolean isPangramUsingSet(String s) {
|
||||
HashSet<Character> alpha = new HashSet<Character>();
|
||||
HashSet<Character> alpha = new HashSet<>();
|
||||
s = s.trim().toLowerCase();
|
||||
for (int i = 0; i < s.length(); i++)
|
||||
if (s.charAt(i) != ' ') alpha.add(s.charAt(i));
|
||||
if (alpha.size() == 26) return true;
|
||||
return false;
|
||||
return alpha.size() == 26;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user