One Line solution!! | 3304. Find the K-th Character in String Game I | Leetcode Daily Challenge

preview_player
Показать описание
Check out the video of today's Daily challenge on Leetcode!
Subscribe for more cool stuffs.

Code Solution in text C++:
int x = __builtin_popcount(k-1); // counts no. of 1s in binary rep of k-1
return 'a' + x;

Hi! I'm Mitadru Datta, IIT KGP'25. I love breaking down complex problems in simple words and hence the vision of this channel. Follow my channel with more upcoming content on interview experiences of various companies and in depth AI and DSA prep.

Hope you have an easy day ahead :)

#leetcode
#leetcodedaily
#leetcodedailychallenge
#dsa #potd
Рекомендации по теме
Комментарии
Автор

man that logic is like crazy, how do you even come up with that, I did brute force by myself but was finding a better solution after seeing the bit manipulation in topic, and i did not even imagine something like this. It was awesome (you earned a subscriber)

paraspatankar
Автор

the bit manipulation part was not clear sir, waha 1 shift 2 shift dikha hee nahi kuch nai board pe

iamstudying
Автор

Damm😬
How can anyone come up with such approach

Mrnerd-svkw
Автор

Most efficient approach
string pattern =


return pattern[k-1];

🤣

aviiraj_sharma
join shbcf.ru