Я порешал немного задачи на leetcode и остался не слишком доволен сервисом.
Leetcode — это онлайн-сайт с задачами по программированию. Даётся описание (какие данные приходят на вход, и что нужно получить). Можно отправить код на любом актуальном языке программирования, и ваше решение будет оценено по двум показателям: скорость и память.
Что не понравилось в сервисе:
1. Встроенный редактор кода поленились делать нормальным, это по сути блокнот без каких-либо хинтов и проверок. Проще сразу писать в IDE, а потом копировать. Но это мелочь, куда серьёзнее второй пункт.
2. Система оценки, о которой я упомянул выше, крайне неточная. Разброс по времени бывает в 1.5-2 раза у одного и того же кода. И, наоборот, почти не показывает важную разницу между разными решениями. По памяти то же самое: цифры плюс минус одинаковые, как бы вы ни решали задачу. Это выражается в том, что легко словить результат типа "Ваше решение лучше, чем 33.33% остальных", причем, много раз подряд. Это значит, что в точности треть решений попадает в какой-то один кластер оценки (либо что решений отправлено очень мало, но сайт популярный, так что не знаю даже). При этом подобная оценка — единственный показатель успешности вашего решения, поэтому она важна, но при таком разбросе теряет смысл.
Хотя сама идея, например, ежедневной новой задачи мне нравится — позволяет разминать мозги и держать себя в тонусе в некотором смысле. Впрочем, тут тоже есть нюанс: эффективное решение задач редко пересекается с правильным и реалистичным решением, которое требовалось бы от программиста в любом практическом сценарии.
Допустим, вам нужно наполнить ведро водой. В обычной жизни вы отнесёте его в ванну, откроете кран и наполните. А вот подход на Leetcode заставляет использовать извращения типа "вытащить из холодильника бутылку воды и разрезать её над ведром". И вот в какой-то момент вы понимаете, что быстрее всего выбросить ведро в окно, потому что под окном глубокая лужа, оно там утонет и технически станет наполненным водой мгновенно. О реальной жизненной применимости такого решения, думаю, говорить не стоит.
Но иногда буду решать. Сегодняшняя задача уровня Hard, такие дают за собеседованиях на middle и senior: поиск максимальной суммы прямоугольника внутри матрицы.
#dev
🌎 Entering the massive Krubera Cave in Georgia is like descending into another world—at over 2,197 meters deep, it’s the deepest known cave on Earth. These underground labyrinths feature rivers, waterfalls, and unique blind creatures, revealing entire ecosystems hidden from sunlight. ✨
#geology⚡#caves⚡#ecosystems
👉subscribe Interesting Planet
🌎 From blazing deserts to frozen poles, Earth's extreme climate zones push life to its limits. In polar regions, temperatures plunge below -50°C, creating icy landscapes where only the hardiest animals, like penguins and polar bears, survive. Meanwhile, equatorial deserts like the Sahara reach scorching highs over 50°C, supporting unique plants and animals adapted to relentless heat. These climate extremes shape our planet’s most remarkable ecosystems and inspire some of nature’s wildest survival strategies. ✨
#climate⚡#ecosystems⚡#adaptation
👉subscribe Interesting Planet
🌍 The Serengeti savanna in Africa hosts one of the world’s largest mammal migrations—zebras cross first, followed by wildebeest, each group timing their journey to feed on different heights of grass. ✨
#savanna⚡#migration⚡#ecosystems⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌍 Africa’s Miombo savanna covers over 2.7 million square kilometers—about the size of Argentina. Its woodlands support hundreds of unique butterfly species found nowhere else on Earth. ✨
#savanna⚡#grasslands⚡#ecosystems⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌎 Hidden off the Pacific coast of California, the Point Dume Submarine Canyon plunges over 800 meters deep just a short distance from shore. Scientists have discovered mysterious methane seeps and rare deep-sea corals within the canyon. These underwater features support unique ecosystems not found anywhere else nearby. ✨
#ocean⚡#canyon⚡#ecosystems
👉subscribe Interesting Planet
👉more Channels
🌎 Some bamboo species can grow up to 91 centimeters in a single day, making bamboo one of the fastest-growing plants on Earth. This rapid growth helps bamboo quickly regenerate after being harvested and provides vital habitats for many animals. ✨
#botany⚡#speed⚡#ecosystems
👉subscribe Interesting Planet
🌎 Deep in the Congo Basin, the African rainforest elephant forges secret trails through dense jungle, creating “elephant highways” that other animals use. These hidden paths help shape entire forest ecosystems by opening routes for seed dispersal and wildlife movement. ✨
#rainforest⚡#elephants⚡#ecosystems
👉subscribe Interesting Planet
🌍 Submarine hydrothermal vents on the ocean floor release superheated water and minerals, fueling unique ecosystems powered by chemical energy instead of sunlight. ✨
#processes⚡#ocean⚡#ecosystems⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography
👉more Channels
🌎 In the dry canyons of the American Southwest, cryptobiotic soil forms a living crust of bacteria, fungi, and lichens. This fragile layer stabilizes desert soil and helps seeds germinate, supporting entire ecosystems in these harsh climates. ✨
#desert⚡#microbiology⚡#ecosystems
👉subscribe Interesting Planet
🌍 Some deep-water corals build reefs in cold, dark oceans thousands of meters below the surface. Unlike tropical reefs, these cold-water reefs thrive without sunlight or warm water. ✨
#coral⚡#marine⚡#ecosystems⚡#ocean⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌍 The highest forests on Earth grow above 4,900 meters in the Andes, where trees survive thin air, cold temperatures, and strong sunlight—an extreme zone where biosphere meets atmosphere and lithosphere. ✨
#spheres⚡#Andes⚡#ecosystems⚡#geography⚡#nature⚡#earth
👉subscribe Amazing Geography🌍
🌎 The tuco-tuco, a South American rodent, lives almost its entire life underground. It digs vast tunnel networks with specialized teeth, rarely surfacing except to gather food. Its burrowing helps aerate soil, making tuco-tucos quiet but essential ecosystem engineers. ✨
#rodents⚡#ecosystems⚡#burrowing
👉subscribe Interesting Planet