LeetCodin
الذهاب إلى القناة على Telegram
1000+ Solved problems | Yechilgan masalalar |🇺🇿|🇬🇧 - Data Structures and Algorithms | Ma'lumotlar tuzilmalari va Algoritmlar - SE at Deloitte, USA LinkedIn: linkedin.com/in/bekhzod-tairov LeetCode: https://leetcode.com/tbekpro/
إظهار المزيدلم يتم تحديد البلدالتكنولوجيات والتطبيقات47 564
1 387
المشتركون
لا توجد بيانات24 ساعات
-37 أيام
لا توجد بيانات30 أيام
أرشيف المشاركات
1 387
Solving 1000 LeetCode problems - EASY!
If you read such a statement, don't believe it! 😉
🚀 Today I'm celebrating 1000 LeetCode problems solved: a journey of dedication and growth! 🚀
I am happy to share a significant milestone in my journey – I have successfully tackled 1000 challenging LeetCode problems! 🎉 This accomplishment has been the result of relentless dedication, countless early mornings, and a commitment to continuous growth.
🌅 400 Days of Consistency: Over the past 400 days, I made it a ritual to rise early and dedicate 1-2 hours daily to solving complex coding problems on LeetCode. This consistent effort has taught me the power of discipline and the incredible outcomes that can be achieved through small, focused actions over an extended period.
💡 Lessons in Problem Solving: Each LeetCode problem I encountered was a unique puzzle, pushing me to think creatively, strategize meticulously, and embrace diverse problem-solving approaches. These challenges not only honed my technical skills but also enhanced my critical thinking and perseverance.
🌟 What's Next: As I celebrate this achievement, I am excited to leverage the skills and insights gained to take on even greater challenges. My journey in the world of coding is far from over, and I'm eager to continue exploring, learning, and contributing to the ever-evolving tech landscape.
#leetcode #codingJourney #milestoneachieved #neverstoplearning #techgrowth #dsa #java #programming
1 387
Repost from Sardor og'a | AI bilan rivojlanamiz
Asr SIRI ochildi!
PHPni orqasida kim turganligini bilarmidingiz?
Ustoz Qudrat Abdurahimov, bu sirni hammaga e'lon qildi😁
Gulla, yashna PHP!
1 387
🇺🇿 669. Trim a Binary Search Tree
🧑💻 Hammaga salom! Regular tarzda post qilmaganimga 3 haftacha bo'libdi. Ammo LeetCode-dagi masalalarni har kuni yechayapman. Keling bugun Binar Qidiruv Daraxtiga oid masalani yechib ko'raylik.
🟡 O'rta daraja: 669. Trim a Binary Search Tree
🧑💻 Mening yechimim: Java 100% Faster | 0ms BFS + DFS Solution
Sizning vazifangiz berilgan diapazonga kiruvchi qiymatlarga ega tugunlarni qoldirish va qolganlarini olib tashlash.
Omad! ✌️🧐
@leetcodin
1 387
🇬🇧 669. Trim a Binary Search Tree
🧑💻 Hi, guys! I haven't been posting regularly for about 3 weeks due to some reasons, but I didn't stop solving LeetCode problems. So, let's go and start with interesting Binary Search Tree problem.
🟡 Medium: 669. Trim a Binary Search Tree
🧑💻 My solution: Java 100% Faster | 0ms BFS + DFS Solution
Your task is to trim given tree such a way that only nodes with values between given range are kept.
Good luck! ✌️🧐
@leetcodin
1 387
🇺🇿 Summary
Bu postda men yozilgan mavzularga havolalarni qoldirmoqchiman. Maqsad - mavzularni tez topa olish. Siz uchun foydali bo'ladi degan umiddaman.
1. Binar daraxtni aylanib o'tishning 3 xili.
2. Rekursiya. Nazariya.
3. Breaking the [bad] habit. Triggerlar.
4. Ma'lumotlar tuzilmasi: Massiv.
5. Java-da Hashtable. To'liq tahlil.
6. Ma'lumotlar tuzilmasi: Linked list.
7. Ma'lumotlar tuzilmasi: Stack va Queue.
8. Saralash algoritmlari.
Shu blogni o'qib borayotganingiz uchun rahmat! ✌️😎
@leetcodin
1 387
🇬🇧 Summary
Let me summarize what we covered so far and share the links to the posts one more time, so that it would be easier to navigate. I hope this will be useful for you.
1. 3 types of binary tree traversal.
2. Recursion. Theory.
3. Breaking the [bad] habit. Triggers.
4. Data Structure: Array.
5. Hashtable in Java. Inside out.
6. Data Structure: Linked list.
7. Data Structures: Stack and Queue.
8. Sorting Algorithms.
Thanks for reading this blog! ✌️😎
@leetcodin
1 387
*I'm back 😁😁
🇬🇧 Yesterday a certain number of new people joined the channel. Brief intro:
On this channel I try to explain Algorithms and Data Structures. Also, I solve the problems on LeetCode and analyze the solutions. 🧑💻
🇺🇿 Kecha bir nechta yangi odam qo'shilibdi. Shuning uchun kichkina tanishuv:
Bu blogda Algoritmlar, Ma'lumot Tuzilmalari va LeetCode-da masalalarni yechib, yaxshilab tushuntirishga harakat qilaman.🧑💻
@leetcodin
1 387
Roses are red
Violets are blue
Always test your code
Before it tests you
from Hassan Rezk Habib
1 387
LeetCode 700.
Achieved another milestone of 700 solved problems on LeetCode.
What went better during these 100 problems:
- Finally reached 75% threshold which means that 75% of solved problems were of medium and hard levels.
- Seeing patterns and applying them to solve problems. Hence, spending less time to find solution.
Let's gooo! 🧑💻🎆
@leetcodin
1 387
Repost from Azim Pulat
FAANGda Amaliyot
Tayyorgarlik -> Jarayon -> Natija
Manba: youtu.be/irZXVknbeQc
0. Rezyume tayyorlash:
- XYZ qonunini ishlatish (9:30)
1. Tayyorlanish uchun kitoblar:
- Grokking Algorithms
- Cracking the Coding Interview
- Algorithm Desing Manual
2. Mashq qilish:
- Leetcode.com
3. O'rganishlarni qo'llash:
- Pramp.com
4. Topshirish 🤷♂️
Sinalgan usul.
1 387
🇺🇿 2579. Count Total Number of Colored Cells
🟡 O'rta daraja: 2579. Count Total Number of Colored Cells
🧑💻 Mening yechimim: Java 1 Line | Math | 100% Faster | Explained
Salom! Kechagi masalaga yechim topamiz.
🧑💻 Vazifa 🧑💻
Sizning vazifangiz - bu har bir daqiqada (n daqiqa davomida) kataklarga, agar qo'shnisi bo'lmasa, qo'shni katak chizish va ularning sonini topish.
🧑💻 G'oya 🧑💻
Agar har xil n uchun kataklarni chizib va hisoblab ko'rsangiz, kataklarning yig'indisi arifmetik progressiyaning yig'indisi bilan bog'liqligini ko'rasiz.
NB: arifmetik progressiyaning d (qo'shni elementlarning farqi) 2ga teng.
Hisoblab chiqqanimdan keyin, kataklar soni nta elementning arifmetik yig'indisi va n-1 ta elementning arifmetik yig'indisi Sum(n) + Sum(n - 1) yoki
Sum(n) + Sum(n) - an => 2 * Sum(n) - an. (a👋)
Arifmetik progressiyaning birinchi elementi ma'lum bo'lgani uchun yig'indini topish uchun keyingi formulani ishlatsangiz bo'ladi:
Sum(n) = ((a1 + an) * n ) / 2.
Bu formulani (a👋) formulaga qo'ysangiz
2 * Sum(n) - an = 2 * ((a1 + an) * n ) / 2 - an = (a1 + an) * n - an. (b👋)
Keling, endi an (oxirgi element)ni topaylik. an = a1 + (n - 1) * d formulasini ishlatsangiz
an = a1 + (n - 1) * d = 1 + (n - 1) * 2 = 1 + 2n - 2 = 2n - 1 => an = 2n - 1.
Va an uchun topilgan ifodani (b👋) formulasiga qo'ysangiz
(a1 + an) * n - an = (a1 + 2 * n - 1) * n - (2 * n - 1) = 2 * n * n - 2 * n + 1 = 2 * n * (n - 1) + 1.
Xullas, javob 2 * n * (n - 1) + 1 bo'ldi.
Tushunarli bo'ldi degan umiddaman.
🧑💻 = 🧑💻 [Dasturlash = Dasturlashga]
Omad! ✌️🧐
@leetcodin
1 387
🇬🇧 2579. Count Total Number of Colored Cells
🟡 Medium: 2579. Count Total Number of Colored Cells
🧑💻 My solution: Java 1 Line | Math | 100% Faster | Explained
Hi! Here is the one of possible solutions for the problem.
🧑💻 Task 🧑💻
Your task is to find the number of cells which you will have after n minutes by drawing touching cells.
🧑💻 Idea 🧑💻
If you pay attention and try drawing and counting cells, you will see that the number of colored cells is somehow connected to arithmetic progression sum.
The difference of each row is 2 (d = 2).
- I found out that the number of cells is the arithmetic progression sum for n plus arithmetic progression sum for n minus an or
Sum(n) + Sum(n) - an => 2 * Sum(n) - an. (a👋)
You know the first number [a1] of the arithmetic sequence [and it is 1].
If Sum(n) = ((a1 + an) * n ) / 2, then the formula (a👋) above will be
2 * Sum(n) - an = 2 * ((a1 + an) * n ) / 2 - an = (a1 + an) * n - an. (b👋)
Now, let's find an. According to the formula an = a1 + (n - 1) * d and this will be
an = 1 + (n - 1) * 2 = 1 + 2n - 2 = 2n - 1 => an = 2n - 1.
Finally, we put an into the formula (b👋)
(a1 + an) * n - an = (a1 + 2 * n - 1) * n - (2 * n - 1) = 2 * n * n - 2 * n + 1 = 2 * n * (n - 1) + 1.
So, the solution is 2 * n * (n - 1) + 1.
Good luck! ✌️🧐
@leetcodin
1 387
🇺🇿 2579. Count Total Number of Colored Cells
Salom! Keling bugun matematika yordamida yechiladigan masalani ko'rib chiqamiz.
🟡 O'rta daraja: 2579. Count Total Number of Colored Cells
🧑💻 Mening yechimim: Java 1 Line | Math | 100% Faster | Explained
Sizning vazifangiz - bu har bir daqiqada (n daqiqa davomida) kataklarga, agar qo'shnisi bo'lmasa, qo'shni katak chizish va ularning sonini topish.
Omad! ✌️🧐
@leetcodin
1 387
🇬🇧 2579. Count Total Number of Colored Cells
Hi! Let's solve one interesting problem using Mathematics.
🟡 Medium: 2579. Count Total Number of Colored Cells
🧑💻 My solution: Java 1 Line | Math | 100% Faster | Explained
Your task is to find the number of cells which you will have after n minutes by drawing touching cells.
Good luck! ✌️🧐
@leetcodin
1 387
🇺🇿 Summary
Hammaga salom! Bu postda men yozilgan mavzularga havolalarni qoldirmoqchiman. Maqsad - mavzularni tez topa olish.
1. Binar daraxtni aylanib o'tishning 3 xili.
2. Rekursiya. Nazariya.
3. Breaking the [bad] habit. Triggerlar.
4. Ma'lumotlar tuzilmasi: Massiv.
5. Java-da Hashtable. To'liq tahlil.
6. Ma'lumotlar tuzilmasi: Linked list.
7. Ma'lumotlar tuzilmasi: Stack va Queue.
8. Saralash algoritmlari.
Shu blogni o'qib borayotganingiz uchun rahmat! ✌️😎
@leetcodin
1 387
🇬🇧 Summary
Hi, guys! Let me summarize what we covered so far and share the links to the posts one more time, so that it would be easier to navigate.
1. 3 types of binary tree traversal.
2. Recursion. Theory.
3. Breaking the [bad] habit. Triggers.
4. Data Structure: Array.
5. Hashtable in Java. Inside out.
6. Data Structure: Linked list.
7. Data Structures: Stack and Queue.
8. Sorting Algorithms.
Thanks for reading this blog! ✌️😎
@leetcodin
1 387
🇺🇿 113. Path Sum II
🟡 O'rta daraja: 113. Path Sum II
🧑💻 Mening yechimim: Java O(N) | DFS | 100% Faster Solution
🧑💻 Vazifa 🧑💻
Sizning vazifangiz - bu binar daraxt bo'ylab aylanib chiqishingizda, tugunlar yig'indisi
targetSum-ga teng bo'lgan har bir "yo'l"-ni topish.
🧑💻 G'oya 🧑💻
Bu masalaning yechimi huddi 112. Path Sum masalaning yechimiga o'xshaydi. Farqli joylarini tushuntirib chiqaman.
🧑💻 Yechim 🧑💻
112. Path Sum -dan farqli joylarini tushuntirib chiqaman.
- Asosiy pathSum() metodi ichida list-lardan iborat list yaratasiz. Bu listResult o'zgaruvchisi sizga javoblarni saqlash uchun kerak bo'ladi.
- Yordamchi goDFS() metodi 2 yangi parametrga ega:
1. list - bu hozirgi "yo'l"-dagi bo'lgan tugunlarning qiymatlarini saqlobchi list.
2. listResult - o'zida javoblarni, ya'ni yig'indisi targetSum-ga teng bo'lgan list-larni saqlovchi list.
- Har bir rekursiv chaqiruv davomida currSum-ni hisoblashdan tashqari node.val-ni list-ning ichiga qo'shib qo'yasiz.
- Agar hozirgi tugun "barg" bo'lsa va shu tugungacha bo'lgan "yo'l"-dagi tugunlarning qiymatlarining yig'indisi targetSum-ga teng bo'lsa, shu list-ni natijaga qo'shib qo'yasiz. E'tibor bering, siz list-ning nusxasini qo'shashiz [new ArrayList<>(list)]. Agar bunday qilmasangiz, siz har safar bir xil list-ga ko'rsatuvchini qo'shgan bo'lasiz.
- Yordamchi rekursiv metodning oxirida tugunning qiymatini olib tashlaysiz. Shu orqali "yo'l"-dagi tugunlarning qiymatlarining tartib to'g'ri saqlanadi.
Omad! ✌️😎
@leetcodin