Logo
TGCATALOG
Catalog Collections Blog
C# LeetCode - tasks

C# LeetCode - tasks

LeetCode C#.

No ratings
622
31.10.2026
622
31.10.2026
No ratings
622
31.10.2026
Safe redirect via bot
О канале

LeetCode C#.

Подписчиков 3,158
Тематика Technology
Язык English
Ссылка t.me/easy_c_sharp_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 tasks in C#.

Latest posts

C# LeetCode - tasks
C# LeetCode - tasks
🔒Открыть пост
и посмотреть медиа
Задача: 599. Minimum Index Sum of Two Lists Сложность: easy Даны два массива строк list1 и list2, необходимо найти общие строки с наименьшей суммой индексов. Общая строка - это строка, которая появляется и в list1, и в list2. Общая строка с наименьшей суммой индексов - это общая строка, такая, что если она появилась в list1[i] и list2[j], то i + j должно быть минимальным значением среди всех других общих строк. Верните все общие строки с наименьшей суммой индексов. Верните ответ в любом порядке. Пример: Input: list1 = ["Shogun","Tapioca Express","Burger King","KFC"], list2 = ["Piatti","The Grill at Torrey Pines","Hungry Hunter Steakhouse","Shogun"] Output: ["Shogun"] Explanation: The only common string is "Shogun". 👨💻 Алгоритм: 1⃣Для каждой строки из list1, сравниваем её с каждой строкой из list2, обходя весь список list2. Используем хэш-таблицу map, которая содержит элементы в виде (сумма: список строк). Здесь сумма относится к сумме индексов совпадающих элементов, а список строк соответствует списку совпадающих строк, чья сумма индексов равна этой сумме. 2⃣Во время сравнений, когда находится совпадение строки на i-м индексе из list1 и j-м индексе из list2, создаём запись в map, соответствующую сумме i + j, если такая запись ещё не существует. Если запись с этой суммой уже существует, добавляем текущую строку в список строк, соответствующих сумме i + j. 3⃣В конце обходим ключи в map и находим список строк, соответствующих ключу с минимальной суммой. 😎 Решение: using System; using System.Collections.Generic; public class Solution { public string[] FindRestaurant(string[] list1, string[] list2) { var map = new Dictionary(); for (int i = 0; i • (); } map[i + j].Add(list1[i]); } } } int minIndexSum = int.MaxValue; foreach (var key in map.Keys) { minIndexSum = Math.Min(minIndexSum, key); } return map[minIndexSum].ToArray(); } } Ставь 👍 и забирай 📚 Базу знаний
C# LeetCode - tasks
FAQ

Open C# LeetCode - tasks 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 C# LeetCode - tasks directly in Telegram unless the resource description says otherwise.

Access depends on the resource. Check the current information in Telegram after opening C# LeetCode - tasks.

The exact features depend on the resource. Open C# LeetCode - tasks to see its current functions, content and access conditions.
Subscriber dynamics
+-1.0% last 30 days
Current
3,158
Month ago
3,190
Average growth
+-1 / day
Updated
5 hours ago

Reviews for channel C# LeetCode - tasks

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