filmov
tv
Custom Sort String | 2 Approaches | Intuition | Meta | Leetcode 791
![preview_player](https://i.ytimg.com/vi/oGPfmp71Zm4/maxresdefault.jpg)
Показать описание
This is the 35th Video of our Playlist "Strings : Popular Interview Problems".
In this video we will try to solve a very good string problem : Custom Sort String | 2 Approaches | Intuition | Meta | Leetcode 791
Share your learnings on LinkedIn, Twitter (X), Instagram, Facebook(Meta) with the hashtag #codestorywithmik & feel free to tag me.
I will explain the intuition so easily that you will never forget and start seeing this as cakewalk EASYYY.
We will do live coding after explanation and see if we are able to pass all the test cases.
Problem Name : Custom Sort String | 2 Approaches | Intuition | Meta | Leetcode 791
Company Tags : META (Facebook)
Approach Summary :
Approach-1:
Approach-2:
This approach utilizes a comparator to sort the characters in the string `str` based on their positions in the specified order. It initializes a vector `index` to store the positions of characters in the order. The sorting is performed using the `sort` function with a lambda comparator. The time complexity is O(nlogn) due to the sorting operation, and the space complexity is O(26) ~ O(1) as the vector `index` is of constant size. This approach provides an alternative solution by directly sorting the characters based on the specified order.
╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
╠╗║╚╝║║╠╗║╚╣║║║║║═╣
╚═╩══╩═╩═╩═╩╝╚╩═╩═╝
✨ Timelines✨
00:00 - Introduction
04:18 - Approach-1
10:43 - Approach-2
22:09 - Coding it up
#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
In this video we will try to solve a very good string problem : Custom Sort String | 2 Approaches | Intuition | Meta | Leetcode 791
Share your learnings on LinkedIn, Twitter (X), Instagram, Facebook(Meta) with the hashtag #codestorywithmik & feel free to tag me.
I will explain the intuition so easily that you will never forget and start seeing this as cakewalk EASYYY.
We will do live coding after explanation and see if we are able to pass all the test cases.
Problem Name : Custom Sort String | 2 Approaches | Intuition | Meta | Leetcode 791
Company Tags : META (Facebook)
Approach Summary :
Approach-1:
Approach-2:
This approach utilizes a comparator to sort the characters in the string `str` based on their positions in the specified order. It initializes a vector `index` to store the positions of characters in the order. The sorting is performed using the `sort` function with a lambda comparator. The time complexity is O(nlogn) due to the sorting operation, and the space complexity is O(26) ~ O(1) as the vector `index` is of constant size. This approach provides an alternative solution by directly sorting the characters based on the specified order.
╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
╠╗║╚╝║║╠╗║╚╣║║║║║═╣
╚═╩══╩═╩═╩═╩╝╚╩═╩═╝
✨ Timelines✨
00:00 - Introduction
04:18 - Approach-1
10:43 - Approach-2
22:09 - Coding it up
#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
Комментарии