Find First Palindromic String in the Array | Multiple Ways | Leetcode 2108
iPad PDF Notes - https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/iPad%20PDF%20Notes/Leetcode-2108-Find%20First%20Palindromic%20String%20in%20the%20Array.pdf
Whatsapp Community Link : https://www.whatsapp.com/channel/0029Va6kVSjICVfiVdsHgi1A
This is the 4th Video of our Playlist "Solving only using C++ STLs".
In this video we will try to solve a good practice problem - Find First Palindromic String in the Array | Leetcode 2108
Using STLs/Library functions only like reverse (C++, JAVA) and std::equal (C++)
Problem Name : Find First Palindromic String in the Array | Leetcode 2108
Company Tags : will update soon
Github Code (C++ & JAVA) : https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/strings/Easy%20Tagged/Find%20First%20Palindromic%20String%20in%20the%20Array.cpp
Leetcode Link : https://leetcode.com/problems/find-first-palindromic-string-in-the-array
Approach Summary :
Approach-1 Summary:
Method: Creating a reversed string for each word and checking if the original word is equal to its reversed form.
Time Complexity (T.C): O(m*n) - m = number of words, n = max length of words.
Space Complexity (S.C): O(n) - Space used for creating the reversed string.
Details: Iterates through the given words, creates a reversed string for each word, and compares it with the original word. Returns the first palindrome found or an empty string if none is found.
Approach-2 Summary:
Method: Using the equal function to check if the first half of the word is equal to its reversed second half.
Time Complexity (T.C): O(m*n) - m = number of words, n = max length of words.
Space Complexity (S.C): O(1) - Constant space as no additional space is used.
Details: Iterates through the given words, checks if the first half of each word is equal to its reversed second half using the equal function. Returns the first palindrome found or an empty string if none is found.
My Recursion Concepts Playlist : https://www.youtube.com/watch?v=pfb1Zduesi8&list=PLpIkg8OmuX-IBcXsfITH5ql0Lqci1MYPM
My DP Concepts Playlist : https://youtu.be/7eLMOE1jnls
My Graph Concepts Playlist : https://youtu.be/5JGiZnr6B5w
My GitHub Repo for interview preparation : https://github.com/MAZHARMIK/Interview_DS_Algo
Subscribe to my channel : https://www.youtube.com/@codestorywithMIK
Instagram : https://www.instagram.com/codestorywithmik/
Facebook : https://www.facebook.com/people/codestorywithmik/100090524295846/
Twitter : https://twitter.com/CSwithMIK
╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
╠╗║╚╝║║╠╗║╚╣║║║║║═╣
╚═╩══╩═╩═╩═╩╝╚╩═╩═╝
#coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #coding #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge#leetcodequestions #leetcodechallenge #hindi #india #hindiexplanation #hindiexplained #easyexplaination #interview#interviewtips #interviewpreparation #interview_ds_algo #hinglish #github #design #data #google #video #instagram #facebook #leetcode #computerscience #leetcodesolutions #leetcodequestionandanswers #code #learning #dsalgo #dsa #2024 #newyear