VOCO канал с интересными разработками, с интересными ботами и конкурсами🌐
🔴Тут вы можете найти интересные разработки, моих ботов, про электронику и всё это на одном канале, поэтому подпишитесь 🐹
💡Также давайте сделаем на 450 подписчиков этого канала розыгрыш 500 звёзд🌟
🎁 Для участия всего лишь нужно быть подписанным на VOCO и SPython
⏳Ждём)
🔴Тут вы можете найти интересные разработки, моих ботов, про электронику и всё это на одном канале, поэтому подпишитесь 🐹
💡Также давайте сделаем на 450 подписчиков этого канала розыгрыш 500 звёзд🌟
🎁 Для участия всего лишь нужно быть подписанным на VOCO и SPython
⏳Ждём)
👍3🔥2🤝1
1. Сумма двух(Two Sum)
👨💻 Задача:
Учитывая массив целых чисел nums и целое число
Продолжение: можете ли вы придумать алгоритм, который будет работать быстрее
📊 Пример:
⚡ Решение:
🧠 Алгоритм решения:
Мы решаем эту задачу с помощью двухпроходной хэш-таблицы. Почему двух? 🤔 Потому что проходимся циклом
1. На первой итерации добавляем значение каждого элемента в качестве ключа и его индекс в качестве значения в хэш-таблицу (ключ — значение элемента, значение — индекс этого элемента).
2. На второй итерации проверяем, существует ли дополнение каждого элемента (
🔍 Важно: Дополнение не должно совпадать с
🔥 15 - и я пойму, что стоит решать и делать такой контент дальше!
#leetcode
👨💻 Задача:
Учитывая массив целых чисел nums и целое число
target
, верните индексы двух чисел, сумма которых равна target
. Вы можете предположить, что для каждого ввода будет ровно одно решение, и вы не можете использовать один и тот же элемент дважды.Вы можете вернуть ответ в любом порядке. Продолжение: можете ли вы придумать алгоритм, который будет работать быстрее
O(n2)
временная сложность?📊 Пример:
Ввод: nums = [2,7,11,15], target = 9
Вывод: [0,1]
Пояснение: Поскольку nums[0] + nums[1] == 9, мы возвращаем [0, 1].
⚡ Решение:
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
hash_map = {}
for i in range(len(nums)):
hash_map[nums[i]] = i
for i in range(len(nums)):
missing_element = target - nums[i]
if missing_element in hash_map and hash_map[missing_element] != i:
return [i, hash_map[missing_element]]
return []
🧠 Алгоритм решения:
Мы решаем эту задачу с помощью двухпроходной хэш-таблицы. Почему двух? 🤔 Потому что проходимся циклом
for
дважды! 1. На первой итерации добавляем значение каждого элемента в качестве ключа и его индекс в качестве значения в хэш-таблицу (ключ — значение элемента, значение — индекс этого элемента).
2. На второй итерации проверяем, существует ли дополнение каждого элемента (
target - nums[i]
) в хэш-таблице. Если оно существует, возвращаем индекс текущего элемента и индекс его дополнения. 🔍 Важно: Дополнение не должно совпадать с
nums[i]
!🔥 15 - и я пойму, что стоит решать и делать такой контент дальше!
#leetcode
🔥4 2👍1😴1
🔥3
Привет, кодеры! 👋
Признаюсь😅, немного выпал из контента… Но я вернулся! 💪
Обещаю: теперь посты будут выходить регулярно – минимум 3 раза в неделю. 🗓️ Буду делиться с вами крутыми штуками про Python, полезными советами и интересными проектами! 🐍
У меня есть большая цель 🎯, и я намерен её достичь! (И, конечно, делиться прогрессом с вами). 📈
А чтобы подзарядиться энергией и вдохновиться на новые свершения, пересылаю вам эту мощнейшую речь для всех, кто пишет код 👇
Признаюсь😅, немного выпал из контента… Но я вернулся! 💪
Обещаю: теперь посты будут выходить регулярно – минимум 3 раза в неделю. 🗓️ Буду делиться с вами крутыми штуками про Python, полезными советами и интересными проектами! 🐍
У меня есть большая цель 🎯, и я намерен её достичь! (И, конечно, делиться прогрессом с вами). 📈
А чтобы подзарядиться энергией и вдохновиться на новые свершения, пересылаю вам эту мощнейшую речь для всех, кто пишет код 👇
1🔥5⚡1 1
Forwarded from Pavel Durov (Paul Du Rove)
#lifestories 🐶
Exactly 18 years ago today, I launched VK—my first large company. Below is the story of how it happened.
I graduated from Saint-Petersburg University in the summer of 2006. I wanted to keep in touch with my former classmates, but I knew it would be hard without a website where everyone could find each other. So, in late August 2006, I set a goal—to build a social network for university students and graduates in four weeks.
I was pretty good at coding. At 12, I built web-based games with vector animations and sound effects. At 13, I was already asked to teach older kids Pascal (a computer language) in summer camps for programmers.
And yet, planning to build a fully-fledged social network in four weeks was overconfident. To make it worse, I decided not to use any ready-made third-party modules. I wanted to create everything from scratch: from profiles and private messages to photo albums and search.
The task seemed too large to grasp. Where do I even start? Back then, my brother Nikolai lived in Germany. Nikolai is a brilliant mathematician and algorithmic programmer, but he’s always considered web development beneath him. At that time, he was focused on his Math thesis at the Max Planck University in Bonn. He refused to help with the code but gave advice: “Write the code for user authorization first,” he said. “You’ll get through.”
This made sense. I started with a login page that generated session IDs. Sessions could then be used to identify users, show them their profile pages, and allow them to edit them. Even the sign-up process could wait: I prepopulated the entries for the first few users manually in the database.
That's when I first understood it clearly: Every complex task is just a combination of many simple ones. If you split a big project into manageable parts and arrange them in the right order, you can get anything done. In theory. In practice, you also encounter all kinds of technical obstacles that test your persistence.
In September 2006, I typically wrote code for 20 hours in a row, had one meal and then slept for 10 hours. After a day of work, I’d boil myself a bucket of pasta and eat it with a generous amount of cheese. No other food was required. I didn’t care whether it was day or night outside. Social connections stopped existing. All that mattered was the code.
I tried to make each section of my project flawless, and that took time. Obsessing over details didn’t help to get everything done in four weeks. But being the only team member allowed me to minimize time spent on internal communication. And since I knew every line of the code base by heart, I could find and fix bugs faster.
On October 10, 2006, I had a beta version of the social network up and running. I called it VKontakte (VK), which means “in contact”. It took me six weeks instead of four to create it. But the result was worth it. Users that I invited from my previous project—a students’ portal I’d been building since 2003—signed up by the thousands and started to invite friends.
I kept adding new features quickly, and competitors struggled to catch up. A few months later, I hired another developer. By that time, VK already had a million members. Within seven years, VK would reach 100 million monthly users. At that point, I was fired by the board of VK, so I left the company to focus fully on Telegram.
That experience of single-handedly building the first version of VK in 2006 was so valuable that it defined my career. As the sole member of the product team, I had to do the work of a front-end developer, back-end developer, UX/UI designer, system administrator, and product manager—all at once. I got to understand the basics of all these jobs. I learned the tiniest details of how a social network works.
I also learned that there are no complex tasks in this world—only many small ones that look scary when combined. Split a big task into smaller parts, organize them in the right sequence—and “you’ll get through”.
Exactly 18 years ago today, I launched VK—my first large company. Below is the story of how it happened.
I graduated from Saint-Petersburg University in the summer of 2006. I wanted to keep in touch with my former classmates, but I knew it would be hard without a website where everyone could find each other. So, in late August 2006, I set a goal—to build a social network for university students and graduates in four weeks.
I was pretty good at coding. At 12, I built web-based games with vector animations and sound effects. At 13, I was already asked to teach older kids Pascal (a computer language) in summer camps for programmers.
And yet, planning to build a fully-fledged social network in four weeks was overconfident. To make it worse, I decided not to use any ready-made third-party modules. I wanted to create everything from scratch: from profiles and private messages to photo albums and search.
The task seemed too large to grasp. Where do I even start? Back then, my brother Nikolai lived in Germany. Nikolai is a brilliant mathematician and algorithmic programmer, but he’s always considered web development beneath him. At that time, he was focused on his Math thesis at the Max Planck University in Bonn. He refused to help with the code but gave advice: “Write the code for user authorization first,” he said. “You’ll get through.”
This made sense. I started with a login page that generated session IDs. Sessions could then be used to identify users, show them their profile pages, and allow them to edit them. Even the sign-up process could wait: I prepopulated the entries for the first few users manually in the database.
That's when I first understood it clearly: Every complex task is just a combination of many simple ones. If you split a big project into manageable parts and arrange them in the right order, you can get anything done. In theory. In practice, you also encounter all kinds of technical obstacles that test your persistence.
In September 2006, I typically wrote code for 20 hours in a row, had one meal and then slept for 10 hours. After a day of work, I’d boil myself a bucket of pasta and eat it with a generous amount of cheese. No other food was required. I didn’t care whether it was day or night outside. Social connections stopped existing. All that mattered was the code.
I tried to make each section of my project flawless, and that took time. Obsessing over details didn’t help to get everything done in four weeks. But being the only team member allowed me to minimize time spent on internal communication. And since I knew every line of the code base by heart, I could find and fix bugs faster.
On October 10, 2006, I had a beta version of the social network up and running. I called it VKontakte (VK), which means “in contact”. It took me six weeks instead of four to create it. But the result was worth it. Users that I invited from my previous project—a students’ portal I’d been building since 2003—signed up by the thousands and started to invite friends.
I kept adding new features quickly, and competitors struggled to catch up. A few months later, I hired another developer. By that time, VK already had a million members. Within seven years, VK would reach 100 million monthly users. At that point, I was fired by the board of VK, so I left the company to focus fully on Telegram.
That experience of single-handedly building the first version of VK in 2006 was so valuable that it defined my career. As the sole member of the product team, I had to do the work of a front-end developer, back-end developer, UX/UI designer, system administrator, and product manager—all at once. I got to understand the basics of all these jobs. I learned the tiniest details of how a social network works.
I also learned that there are no complex tasks in this world—only many small ones that look scary when combined. Split a big task into smaller parts, organize them in the right sequence—and “you’ll get through”.
Please open Telegram to view this post
VIEW IN TELEGRAM
1 7
Всем привет!
Бесплатно слушать и скачивать музыку и добавлять в избранное теперь тут 👇
Недавно бота сделал, думаю неплохой получился, кто хочет может затестить @SMusic7_Bot, всем спасибо 😋!
Обязательно будут выходить доработки и новые фишки, всë завист от вашей активности 💪
Бесплатно слушать и скачивать музыку и добавлять в избранное теперь тут 👇
Недавно бота сделал, думаю неплохой получился, кто хочет может затестить @SMusic7_Bot, всем спасибо 😋!
Обязательно будут выходить доработки и новые фишки, всë завист от вашей активности 💪
⚡6👍2🔥1
🐍 Декораторы в Python 🧠
Сегодня у нас на повестке дня штука, которая превращает ваш код из обычной лапши в изысканный итальянский деликатес! 🍝
🔥 Нууу, а если без юмора, в данном материале мы подробно рассмотрим концепцию декораторов, их синтаксис и практическое применение, преимущества и много другое. 📚
⚡Декораторы позволяют расширять функциональность существующих функций, не изменяя их исходный код.
Ну вообщем всё ниже👇
#урок
Сегодня у нас на повестке дня штука, которая превращает ваш код из обычной лапши в изысканный итальянский деликатес! 🍝
🔥 Нууу, а если без юмора, в данном материале мы подробно рассмотрим концепцию декораторов, их синтаксис и практическое применение, преимущества и много другое. 📚
⚡Декораторы позволяют расширять функциональность существующих функций, не изменяя их исходный код.
Ну вообщем всё ниже👇
#урок
🔥4
Доброе утро, всем!
🔥 Кто думал что @SMusic7_Bot будет иметь только две основные функции, то вы ощибались, будут проходить обновление, ближайщее через 2 недели😋, будут добавленны новые фишки и много чего интересного!
⚡ Если у вас есть свои идеи, пишите в комментариях, попробуем реализовать их
🔥 Кто думал что @SMusic7_Bot будет иметь только две основные функции, то вы ощибались, будут проходить обновление, ближайщее через 2 недели😋, будут добавленны новые фишки и много чего интересного!
⚡ Если у вас есть свои идеи, пишите в комментариях, попробуем реализовать их
🔥5👍2⚡1👌1
🌷 Дорогие дамы!
С Международным женским днем! 💖
Желаем вам счастья, здоровья и исполнения всех ваших желаний. Пусть каждый день будет наполнен радостью и улыбками!
С праздником! 🌺
С Международным женским днем! 💖
Желаем вам счастья, здоровья и исполнения всех ваших желаний. Пусть каждый день будет наполнен радостью и улыбками!
С праздником! 🌺
❤4👏1
Привет! 👋 Обновление бота(@SMusic7_Bot) выходит раньше срока – уже завтра! 🚀 Вас ждет финальная версия с новыми фишками:
🧠 Распознавание музыки по голосу!
🌍 Топ-10 самых популярных песен в мире!
🏆 Топ-5 хитов по странам!
А на следующей неделе – совместная охота на “божьих коровок” (баги 😉), которые вы найдете! Спасибо за вашу поддержку! 🙏
🧠 Распознавание музыки по голосу!
🌍 Топ-10 самых популярных песен в мире!
🏆 Топ-5 хитов по странам!
А на следующей неделе – совместная охота на “божьих коровок” (баги 😉), которые вы найдете! Спасибо за вашу поддержку! 🙏
🔥3👾2
🙃 Такс, такс, преимущественно для 11-классников (и не только), не знаю, много ли таких тут, но всё же (для тех, кому это неинтересно — пункт 2):
1. Есть очень крутая олимпиада по анализу данных — DANO, организованная Вышкой.
Состоит из трёх этапов, и самый интересный — 3-й, где нужно делать командный проект.
Причём команды формируются самостоятельно, так что если хочешь в тиму — пиши в ЛС, про плюшки тоже расскажу(а там их прилично)! 😉
2. Задачка с собесов(часто встречается в FAANG) :
"Лучшее время для покупки и продажи акций" (Best Time to Buy and Sell Stock):
Вам дан массив целых чисел, где каждое число представляет цену акции на определённый день. Найдите максимальную прибыль, которую можно получить, купив и продав акцию ровно один раз. Вы должны купить акцию до того, как продать её.
Пример:
📈 Купить на 2-й день за 1, продать на 5-й день за 6, прибыль = 5.
📉 Если прибыль невозможна (цены только падают), вернуть 0.
Кто решит, может скинуть задачу и объяснить(по методу Фейнмана)
✌Всём удачи!
1. Есть очень крутая олимпиада по анализу данных — DANO, организованная Вышкой.
Состоит из трёх этапов, и самый интересный — 3-й, где нужно делать командный проект.
Причём команды формируются самостоятельно, так что если хочешь в тиму — пиши в ЛС, про плюшки тоже расскажу(а там их прилично)! 😉
2. Задачка с собесов(часто встречается в FAANG) :
"Лучшее время для покупки и продажи акций" (Best Time to Buy and Sell Stock):
Вам дан массив целых чисел, где каждое число представляет цену акции на определённый день. Найдите максимальную прибыль, которую можно получить, купив и продав акцию ровно один раз. Вы должны купить акцию до того, как продать её.
Пример:
Вход: [7, 1, 5, 3, 6, 4]
Выход: 5
📈 Купить на 2-й день за 1, продать на 5-й день за 6, прибыль = 5.
📉 Если прибыль невозможна (цены только падают), вернуть 0.
Кто решит, может скинуть задачу и объяснить(по методу Фейнмана)
✌Всём удачи!
🔥3⚡2👌1