forked from thisisshub/HacktoberFest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Leetcode Solution of isPangram in JAVA
- Loading branch information
1 parent
6fc5936
commit 1ab94a6
Showing
3 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* Solving Que. 1832 Check if the Sentence Is Pangram => https://leetcode.com/problems/check-if-the-sentence-is-pangram/submissions/ */ | ||
|
||
import java.util.Arrays; | ||
|
||
public class isPangramSentence { | ||
public static void main(String[] args) { | ||
String sentence = "aaaaaaaaa"; | ||
boolean[] arr = new boolean[26]; | ||
|
||
for (int i = 0; i < sentence.length() ; i++) { | ||
arr[sentence.charAt(i) - 97] = true; | ||
} | ||
boolean a =isPan(arr); | ||
System.out.println(a); | ||
} | ||
|
||
public static boolean isPan(boolean[] arr) | ||
{ | ||
for (int i = 0; i < 26 ; i++) { | ||
if (arr[i] == false) | ||
{ | ||
return false; | ||
} | ||
} | ||
return true; | ||
} | ||
} |