Check if string is pangram | String Interview Question

  Рет қаралды 6,026

CppNuts

CppNuts

Күн бұрын

JOIN ME
-----
KZbin 🎬 / @cppnuts
Patreon 🚀 / cppnuts
COMPLETE PLAYLIST
------------
C++ Tutorial For Beginners: • Introduction To C++
STL (Standard Template Library): • STL In C++
ThreadIng In C++: • Multithreading In C++
Data Structures: • Data Structure
Algorithms: • Binary Search
Design Patterns: • Factory Design Pattern...
Smart Pointers: • Smart Pointer In C++
C++14: • Digit Separator In C++
C++17: • std string_view in C++...
C++ All Type Casts: • static_cast In C++
INTERVIEW PLAYLIST
------------
C++ Interview Q&A: • Structural Padding & P...
C++ Interview Q&A For Experienced: • How delete[] Knows How...
Linked List Interview Questions: • Find Kth Node From Bac...
BST Interview Questions: • Search Element In Bina...
Array Interview Questions: • Reverse An Array
String Interview Questions: • Check String Is Palind...
Bit Manipulation Questions: • Find Set Bit In Intege...
Binary Tree Interview Question: • Invert Binary Tree
Sorting Algorithms: • Bubble Sort
C++ MCQ: • Video
C MCQ: • What printf returns af...
C Interview Questions: • Designated Initializat...
QUICK SHORT VIDEOS
-------------
C++ Short : • C++ Short Videos
C Short : • Shorts C Programming MCQ
In this video we will learn how to check if given string is pangram or not.
I have explained a very simple and faster approach to this problem.
#cpp #string #programming #interviewquestion #computerscience

Пікірлер: 10
@a6xx824
@a6xx824 7 ай бұрын
Sir this is simplist that anyone has explain all salo auro ko khud nhi pta ky bol rhe hai really thank you appreciate❤😊
@photos9350
@photos9350 3 ай бұрын
you were solving this question on leetcode and today i did the same solution as yours which beats only 20% in both time an space , best solution would be: int arr[26]={0}; for(int i=0;i
@aby_yadav
@aby_yadav 2 жыл бұрын
My psudo solution: unordered_set tset; for(const auto& ch : input_str){ tset.insert(tolower(ch)); return true if tset.size()==26; } return false;
@alexandresendra
@alexandresendra 2 жыл бұрын
What if you do : std::map myMap; for each character { myMap[e] = true; } return myMap.Size() == 26 Is it faster ?
@CppNuts
@CppNuts 2 жыл бұрын
No, because with tree there will be cache miss, but with array as the size is 26 it is possible that once it will load the entire array in cache and wound never go back to RAM.
@nikhilreddy6476
@nikhilreddy6476 2 жыл бұрын
I think your algorithm will continue checking for the whole string(lets say length is 10000000) and what will happen if the first 26 elements will already have A-Z ? then we keep on checking the rest of string? i think it might be unnecessary. I would prefer vector to be int rather than bool and for every first time we encounter new letter I will increment counter and when counter reaches 26 i will return true. if not false.
@CppNuts
@CppNuts 2 жыл бұрын
This should work with very big string, but I doubt also because we would need two extra things, increment and if check. So in average it might slow down also. But not sure, we should check. Because the worst case might be like we have all A from beginning and in the end B - Z then we have to pay very big penalty.
@mdtarikbosunia2435
@mdtarikbosunia2435 2 жыл бұрын
@aloklinku
@aloklinku 2 жыл бұрын
👍
@CppNuts
@CppNuts 2 жыл бұрын
👍
Valid Parentheses
4:24
CppNuts
Рет қаралды 518
Check If One String Is Rotation Of Another String
4:25
CppNuts
Рет қаралды 6 М.
SLIDE #shortssprintbrasil
0:31
Natan por Aí
Рет қаралды 49 МЛН
Хаги Ваги говорит разными голосами
0:22
Фани Хани
Рет қаралды 2,2 МЛН
Java Program to check given String is Panagram or not?
8:24
Learn With KrishnaSandeep
Рет қаралды 60 М.
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
Sahil & Sarra
Рет қаралды 694 М.
Check If A String Is A Palindrome | C Programming Example
10:56
Portfolio Courses
Рет қаралды 45 М.
Pangram Program in Java | Pangram Problem Solution | Interview Questions on Pangram | ABC
16:53
ABC - Technology Training & Upskilling
Рет қаралды 56 М.
Function Pointers In C
16:03
CppNuts
Рет қаралды 40 М.
Top 5 C++ Interview Questions to Test Your Programming Prowess
13:39
int *p vs int* p Pointer Declarations | C Programming Tutorial
6:12
Portfolio Courses
Рет қаралды 144 М.