Skip to content

Commit

Permalink
Added Leetcode Solution of isPangram in JAVA
Browse files Browse the repository at this point in the history
  • Loading branch information
Yash-verma18 committed Oct 1, 2021
1 parent 6fc5936 commit 1ab94a6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
Binary file added Java/Main.class
Binary file not shown.
Binary file added Java/isPangramSentence.class
Binary file not shown.
27 changes: 27 additions & 0 deletions Java/isPangramSentence.java
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;
}
}

0 comments on commit 1ab94a6

Please sign in to comment.