Logo
TGCATALOG
Catalog Collections Blog
Golang | LeetCode

Golang | LeetCode

LeetCode tasks in Golang. Solutions with code and explanations.

No ratings
375
02.12.2026
375
02.12.2026
No ratings
375
02.12.2026
Safe redirect via bot
О канале

LeetCode tasks in Golang. Solutions with code and explanations.

Подписчиков —
Тематика Technology
Ссылка @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

Channel with solutions to popular LeetCode tasks in Go. Focus on optimized algorithms, efficient memory usage, and idiomatic code. Helps prepare for technical interviews in companies that use Golang.

Latest posts

Golang | LeetCode
Golang | LeetCode
🔒Открыть пост
и посмотреть медиа
Задача: 1262. Greatest Sum Divisible by Three Сложность: medium Если задан целочисленный массив nums, верните максимально возможную сумму элементов массива, которая делится на три. Пример: Input: nums = [3,6,5,1,8] Output: 18 👨💻 Алгоритм: 1⃣Найдите сумму всех элементов массива. 2⃣Если сумма делится на 3, то она и есть ответ. 3⃣Если сумма при делении на 3 дает остаток 1, удалите один элемент с остатком 1 или два элемента с остатком 2 (если их сумма равна 2). Если сумма при делении на 3 дает остаток 2, удалите один элемент с остатком 2 или два элемента с остатком 1 (если их сумма равна 2). 😎 Решение: import (     "sort" ) func maxSumDivThree(nums []int) int {     totalSum := 0     for _, num := range nums {         totalSum += num     }     if totalSum % 3 == 0 {         return totalSum     }         mod1 := []int{}     mod2 := []int{}         for _, num := range nums {         if num % 3 == 1 {             mod1 = append(mod1, num)         } else if num % 3 == 2 {             mod2 = append(mod2, num)         }     }         sort.Ints(mod1)     sort.Ints(mod2)         if totalSum % 3 == 1 {         remove1 := int(^uint(0) >> 1) // maximum int         if len(mod1) > 0 {             remove1 = mod1[0]         }         remove2 := int(^uint(0) >> 1)         if len(mod2) >= 2 {             remove2 = mod2[0] + mod2[1]         }         if remove1 < remove2 {             return totalSum - remove1         } else {             return totalSum - remove2         }     } else {         remove2 := int(^uint(0) >> 1)         if len(mod2) > 0 {             remove2 = mod2[0]         }         remove1 := int(^uint(0) >> 1)         if len(mod1) >= 2 {             remove1 = mod1[0] + mod1[1]         }         if remove2 < remove1 {             return totalSum - remove2         } else {             return totalSum - remove1         }     } } Ставь 👍 и забирай 📚 Базу знаний
Golang | LeetCode
FAQ

Open Golang | LeetCode in Telegram and press the Start button. No separate registration is required.

Yes. The service is designed to be straightforward: open the resource, follow the on-screen instructions and start using it.

No. You can use Golang | LeetCode directly in Telegram unless the resource description says otherwise.

Access depends on the resource. Check the current information in Telegram after opening Golang | LeetCode.

The exact features depend on the resource. Open Golang | LeetCode to see its current functions, content and access conditions.

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

Loading
Switch to Light Theme
Home Catalog Collections Blog Login