Back to Browse

Check if One String Swap Can Make Strings Equal | 2 Approaches | Leetcode 1790 | codestorywithMIK

4.4K views
Feb 5, 2025
17:02

Whatsapp Community Link : https://www.whatsapp.com/channel/0029Va6kVSjICVfiVdsHgi1A Hi Everyone, this is the 68th video of our Playlist "Leetcode Easy". Now we will be solving an easy practice problem on Array - Check if One String Swap Can Make Strings Equal | 2 Approaches | Leetcode 1790 | codestorywithMIK We will solve it using 2 Approaches and will see different examples to get more clarity. Problem Name : Check if One String Swap Can Make Strings Equal | 2 Approaches | Leetcode 1790 | codestorywithMIK Company Tags : will update later My solutions on Github(C++ & JAVA) - https://github.com/MAZHARMIK/Interview_DS_Algo/blob/master/strings/Easy%20Tagged/Check%20if%20One%20String%20Swap%20Can%20Make%20Strings%20Equal.cpp Leetcode Link : https://leetcode.com/problems/check-if-one-string-swap-can-make-strings-equal My DP Concepts Playlist : https://youtu.be/7eLMOE1jnls My Graph Concepts Playlist : https://youtu.be/5JGiZnr6B5w My Segment Tree Concepts Playlist : https://www.youtube.com/watch?v=k99r1A7krcY&list=PLpIkg8OmuX-K1qUIQToCllUO0UIKXt8dB My Recursion Concepts Playlist : https://www.youtube.com/watch?v=pfb1Zduesi8&list=PLpIkg8OmuX-IBcXsfITH5ql0Lqci1MYPM Trie Playlist - https://www.youtube.com/watch?v=DMP2bqW6URA&list=PLpIkg8OmuX-I99uuP2BZOz4mI_lms4gVG Difference Array Technique: Concepts & Qns : https://www.youtube.com/watch?v=ZHNVmtm08WY&list=PLpIkg8OmuX-Kqkb8DqDe_4-Tiav6ilS_L My GitHub Repo for interview preparation : https://github.com/MAZHARMIK/Interview_DS_Algo Instagram : https://www.instagram.com/codestorywithmik/ Facebook : https://www.facebook.com/people/codestorywithmik/100090524295846/ Twitter : https://twitter.com/CSwithMIK Subscribe to my channel : https://www.youtube.com/@codestorywithMIK ╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗ ║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣ ╠╗║╚╝║║╠╗║╚╣║║║║║═╣ ╚═╩══╩═╩═╩═╩╝╚╩═╩═╝ Video Summary : Approach-1 (using map and counting) Intuition: Count the frequency of each character in both strings and track the differing positions. If there are more than two differences or mismatched character counts, the strings can't be made equal with one swap. Approach-2 (using counting only, no map required) Intuition: Identify the indices where characters differ. If exactly two positions differ, swapping these characters should make the strings equal. ✨ Timelines ✨ 00:00 - Introduction 00:20 - Motivation 00:44 - Problem Explanation 02:26 - Approach-1 (Brute Force) 10:38 - Approach-2 (Optimal) 13:10 - Coding it up #MIK #mik #Mik #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #helpajobseeker #easyrecipes #leetcode #leetcodequestionandanswers #leetcodesolution #leetcodedailychallenge #leetcodequestions #leetcodechallenge #hindi #india #hindiexplanation #hindiexplained #easyexplaination #interview#interviewtips #interviewpreparation #hinglish #github #design #data #google #video #instagram #facebook #leetcode #computerscience #leetcodesolutions #leetcodequestionandanswers #code #learning #dsalgo #dsa #coding #programming #developers #techjobs #datastructures #algorithms #webdevelopment #softwareengineering #computerscience #pythoncoding #codinglife #coderlife #leetcode #leetcodesolutions #leetcodedailychallenge #codinginterview #interviewprep #technicalinterview #interviewtips #interviewquestions #codingchallenges #interviewready #dsa #hindi #india #hindicoding #hindiprogramming #hindiexplanation #hindidevelopers #hinditech #hindilearning #helpajobseeker #jobseekers #jobsearchtips #careergoals #careerdevelopment #jobhunt #jobinterview #github #designthinking #learningtogether #growthmindset #digitalcontent #techcontent #socialmediagrowth #contentcreation #codestorywithmik #codestorywithmick #codestorywitmik #codestorywthmik #codstorywithmik #codestorywihmik #codestorywithmiik #codeistorywithmik #codestorywithmk #codestorywitmick #codestorymik #codestorwithmik

Download

0 formats

No download links available.

Check if One String Swap Can Make Strings Equal | 2 Approaches | Leetcode 1790 | codestorywithMIK | NatokHD