If you’re new to programming but want a career in tech, I HIGHLY RECOMMEND applying to one of Springboard’s online coding bootcamps (use code ALEXLEE for $1,000 off): bit.ly/3HX970h
I have done this way: static void isPangram(String data){ char[] str = data.replace(" ","").toUpperCase().toCharArray(); int size = str.length; int[] newA = new int[26]; int i=0; while (i!=size){ int index = str[i]-65; newA[index] = 1; i++; } int j=0; while (j!=26){ if(newA[j]==1){ j++; }else{ System.out.println("Non-Pangram..!"); System.exit(0); } } System.out.println("Pangram String"); }
There’s a problem with your solution. It only find the character of your pangram to see if it’s within range. If you have 26 letter only consist of ‘z’ your pangram will still be true. Am I right ?
its not like that la, for example character 'C' - 'A' will result in 2, which will store in mark[2]. In ur case 26 of 'z' will result in only mark[25] is true la.
I hate using Java so much but mate your videos are just absolutely exceptional, this is so fantastic for revisiting all the stuff I've forgotten/and am yet to learn!!!!
If you’re new to programming but want a career in tech, I HIGHLY RECOMMEND applying to one of Springboard’s online coding bootcamps (use code ALEXLEE for $1,000 off): bit.ly/3HX970h
Sir good knowledge given thanks
wouldnt it be simple to use Character.toUpperCase() on every letter instead of having that condition?
LordMZTE that could work too :)
I have done this way:
static void isPangram(String data){
char[] str = data.replace(" ","").toUpperCase().toCharArray();
int size = str.length;
int[] newA = new int[26];
int i=0;
while (i!=size){
int index = str[i]-65;
newA[index] = 1;
i++;
}
int j=0;
while (j!=26){
if(newA[j]==1){
j++;
}else{
System.out.println("Non-Pangram..!");
System.exit(0);
}
}
System.out.println("Pangram String");
}
Great work !!
Did you make a video about printf if not can you please make one?
Thank you
If the first character is not a letter mark[0] would be marked true since index starts at 0 and we always mark even if it is not a letter.
You can use Array.toString to view the array as a whole .
Excellent bro
There’s a problem with your solution. It only find the character of your pangram to see if it’s within range. If you have 26 letter only consist of ‘z’ your pangram will still be true. Am I right ?
its not like that la, for example character 'C' - 'A' will result in 2, which will store in mark[2]. In ur case 26 of 'z' will result in only mark[25] is true la.
@@純粹名字that’s right. I misread the Boolean [] part
God damn these videos are helpful thank you keep them coming :)
@Tobias Wayne bot
I hate using Java so much but mate your videos are just absolutely exceptional, this is so fantastic for revisiting all the stuff I've forgotten/and am yet to learn!!!!
Why do you hate java???????
I got it now bro
Can u make a tutorial on arrays
Beep boop first
*_sends blue shell_* oh, really???