You explained all test cases and covered the interview case also. Also you explained why space complexity is O(1). Many say space complexity is O(n) but they don't explain why it is so. Thank you sir
@nikoo289 ай бұрын
Excellent
@inspiredomkar1239 Жыл бұрын
import java.util.Arrays; import java.util.HashSet; class Solution { public boolean checkIfPangram(String sentence) { char[] charArray = sentence.toCharArray(); HashSet hashSet = new HashSet(); for (char c : charArray) { hashSet.add(c); } return hashSet.size() == 26; } } Here's how i coded this solution.
@sasidharnaidu45077 ай бұрын
You can add one more if statement that if length of str less than 26, return false
@tanishkaagarwal6750 Жыл бұрын
Thank you so much sir. Your teaching style is awesome.
@nikoo28 Жыл бұрын
So nice of you
@shwetasdhake79864 ай бұрын
Your Code: Checks for empty Set during iteration and incorrectly initializes the Set with letters 'a' to 'z'. Instead, we can directly adds characters from the sentence to the Set and checks if the Set contains all 26 letters at the end.
Also we can push char into set and check if hashset length equal to 26 that's mean all characters found and return true else at the end return false. Is this approach correct ?
@nikoo28 Жыл бұрын
yes, that approach is also correct. :)
@pavankumarpadamati86069 ай бұрын
But it is taking time i.e like 7ms like that .. public boolean checkIfPangram(String sentence) { for(char i='a';i
@hoddybhaba6704 Жыл бұрын
Bro ..please do video on Leetcode #2384 - Largest Palindromic Number . I did got this in the interview..
@nikoo28 Жыл бұрын
What interview did you get this in?
@hoddybhaba6704 Жыл бұрын
@@nikoo28 got that in the Citi bank coding test.
@shivanimishra2448 Жыл бұрын
Got this question in my last OA round
@nikoo28 Жыл бұрын
What company?
@shivanimishra2448 Жыл бұрын
@@nikoo28 Xactly
@Bhavya__Garg Жыл бұрын
Sir, Please explain " 36. Valid Sudoku " problem from leetcode
@nikoo28 Жыл бұрын
sure, I will add it to my list of upcoming videos
@ashishgaikwad88579 ай бұрын
Thank you so much
@cremewe67007 ай бұрын
00:02 A Pangram is a string containing all English alphabet letters at least once. 01:36 Identifying Pangram using character iteration 03:07 Efficiently check if a sentence is a Pangram 04:48 Iterate through the string and change array values to 1 for each character encountered. 06:28 Optimizing for edge cases with efficient approach using hash set 08:06 Removing characters from a hashset leads to time savings 09:37 Create hash set, iterate through string, check for pangram 11:16 Be mindful of edge cases and character considerations in problem solving Crafted by Merlin AI.
@nikoo287 ай бұрын
Is there an AI tool that did this automatically?
@praveenraja8597 ай бұрын
@@nikoo28
@SergekSh Жыл бұрын
Good Job Man!
@nikoo28 Жыл бұрын
Thanks!
@vivekmalviya30366 ай бұрын
Bhai aap agar hindi me video banyenge to jyada views jayenga Kyoki leet code ke hindi me acche solution nhi h Thank u bhai
@nikoo286 ай бұрын
Do the subtitles help?
@sagarswagatsahoo47748 ай бұрын
Its z sir not g
@himanshugupta599811 ай бұрын
what if the string contains some upper case letters
@aayushraj291811 ай бұрын
Just convert the character x to lower
@nikoo2810 ай бұрын
always check the problem constraints. If you have upper case letters, then yes...you will have to modify the code a little.