Logo
TGCATALOG
Catalog Collections Blog
Golang | LeetCode

Golang | LeetCode

LeetCode задачи на Golang. Решения с кодом и объяснениями.

No ratings
51
10.09.2026
51
10.09.2026
No ratings
51
10.09.2026
Safe redirect via bot
О канале

LeetCode задачи на Golang. Решения с кодом и объяснениями.

Подписчиков 3,616
Тематика Technology
Язык English
Ссылка t.me/easy_golang_task

We also recommend

Kekaton AI | Voiceover and voice clone
Kekaton AI | Voiceover and voice clone
Bot

AI bot for text-to-speech and voice cloning in Telegram. Create audio using neural network quickly and easily.

Description

Канал с решениями популярных LeetCode задач на языке Go. Фокус на оптимизированных алгоритмах, эффективном использовании памяти и идиоматичном коде. Поможет подготовиться к техническим интервью в компаниях, где используют Golang.

Latest posts

Golang | LeetCode
Golang | LeetCode
🔒Открыть пост
и посмотреть медиа
Задача: 1277. Count Square Submatrices with All Ones Сложность: medium Если задана матрица m * n из единиц и нулей, верните, сколько квадратных подматриц имеют все единицы. Пример: Input: matrix = [   [0,1,1,1],   [1,1,1,1],   [0,1,1,1] ] Output: 15 👨💻 Алгоритм: 1⃣Создайте вспомогательную матрицу dp таких же размеров, что и исходная матрица, для хранения размеров максимальных квадратов. 2⃣Пройдите по каждому элементу матрицы и обновите dp следующим образом: если элемент равен 1, то dp[i][j] = min(dp[i-1][j], dp[i][j-1], dp[i-1][j-1]) + 1. 3⃣Суммируйте все значения в dp, чтобы получить количество квадратных подматриц, состоящих из всех единиц. 😎 Решение: func countSquares(matrix [][]int) int {     m := len(matrix)     n := len(matrix[0])     dp := make([][]int, m)     for i := range dp {         dp[i] = make([]int, n)     }     count := 0     for i := 0; i < m; i++ {         for j := 0; j < n; j++ {             if matrix[i][j] == 1 {                 if i == 0 || j == 0 {                     dp[i][j] = 1                 } else {                     dp[i][j] = min(dp[i-1][j], min(dp[i][j-1], dp[i-1][j-1])) + 1                 }                 count += dp[i][j]             }         }     }     return count } func min(a, b int) int {     if a < b {         return a     }     return b } Ставь 👍 и забирай 📚 Базу знаний
Golang | LeetCode
Subscriber dynamics
+-0.1% last 30 days
Current
3,616
Month ago
3,619
Average growth
+0 / day
Updated
10 hours ago

Reviews for channel Golang | LeetCode

Log in to leave a review

Only registered users can share their opinion.

No reviews yet

Be the first to share your impression of this resource!

Similar resources

News and developmentsAPIVK ORD with documentation.

Channel

The news channel of the Motor Show Drive Motors in Tyumen.

Channel

A team that fixes mopeds and has fun.

Channel
Switch to Light Theme
Home Catalog Collections Blog Login