Get Mystery Box with random crypto!

LeetCodin

Telegram kanalining logotibi leetcodin — LeetCodin L
Telegram kanalining logotibi leetcodin — LeetCodin
Kanal manzili: @leetcodin
Toifalar: Taʼlim
Til: Oʻzbek tili
Obunachilar: 1.46K
Kanalning ta’rifi

800 Solved problems | Yechilgan masalalar
|🇺🇿|🇬🇧
- Data Structures and Algorithms | Ma'lumotlar tuzilmalari va Algoritmlar
- SE @EPAM
LinkedIn: linkedin.com/in/bekhzod-tairov
LeetCode: https://leetcode.com/tbekpro/
Git: https://github.com/GquaD/LeetCode

Ratings & Reviews

2.33

3 reviews

Reviews can be left only by registered users. All reviews are moderated by admins.

5 stars

0

4 stars

0

3 stars

1

2 stars

2

1 stars

0


Oxirgi xabar

2023-03-27 13:31:29 Roses are red
Violets are blue
Always test your code
Before it tests you

from Hassan Rezk Habib
795 views10:31
Ochish/sharhlash
2023-03-25 08:17:41
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
897 views05:17
Ochish/sharhlash
2023-03-22 11:13:58
FAANGda Amaliyot
Tayyorgarlik -> Jarayon -> Natija

Manba:



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.
796 views08:13
Ochish/sharhlash
2023-03-18 19:21:01
@leetcodin
1.3K views16:21
Ochish/sharhlash
2023-03-18 17:19:01 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.2K views14:19
Ochish/sharhlash
2023-03-18 17:19:01 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
734 views14:19
Ochish/sharhlash
2023-03-17 15:17:00 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
813 views12:17
Ochish/sharhlash
2023-03-17 15:17:00 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
780 views12:17
Ochish/sharhlash
2023-03-17 08:10:00


@leetcodin
999 views05:10
Ochish/sharhlash
2023-03-15 17:19:01 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
901 views14:19
Ochish/sharhlash