Smallest String With A Given Numeric Value | Live Coding with Explanation | Leetcode #1663

preview_player
Показать описание
Discussed 2 approaches for the problem.

To support us you can donate

Check out our other popular playlists:

If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful.

#coding #leetcode #programminglife #programmingisfun #programmer #tech #software #codinglife #leetcode
Рекомендации по теме
Комментарии
Автор

We hope you all are enjoying our videos!!! Don't forget to leave a comment!!! Please like the video to support us!!!

Questions you might like:

Struggling in a question??

Leave in a comment and we will make a video!!!🙂🙂🙂

AlgorithmsMadeEasy
Автор

I never expected this clear explanation from someone. Kudos to you bro!!

deepankar
Автор

class Solution {
public:
string getSmallestString(int n, int k) {
string ans="";
unordered_map<int, char>m;
char strt ='a';
for(int i =1;i<=26;i++){
m[i]=strt;
strt++;
}
for(int i =0;i<n;i++){
for(int j=1;j<=26;j++){
if(k-j <=26*(n-1-i)){
ans+=m[j];
k-=j;
break;
}
}
}
return ans;
}
};

varunsinghal
Автор

Plz plz use dark mode in code editor🙏 coz i watch ur videos at night.

ashwinvarma
join shbcf.ru