//https://leetcode.com/problems/two-sum/
public class Solution {
public class TwoSum
{
public int[] TwoSum(int[] nums, int target) {
var dict = new Dictionary<int, int>();
for (int i = 0; i < nums.Length; i++)
{
if (dict.ContainsKey(nums[i]))
return new int[] { i, dict[nums[i]] };
int diff = target - nums[i];
dict.Add(diff, i);
}
return null;
}
}
}
-
MY PROJECTS
-
Recent Posts
- Java.DBMigrationTools.Can you use the same migration tool for multiple databases?
- Java.DBMigrationTools.How do you view migration history?
- Java.DBMigrationTools.How do you reset all migrations?
- Java.DBMigrationTools.How do you skip a migration?
- Java.DBMigrationTools.How do you run migrations for test environments?
- Java.DBMigrationTools.If multiple replicas start at once (you need to ensure only one runs migrations)
- Java.DBMigrationTools.Can migration tools be used with Docker?
- Java.DBMigrationTools.How do you run a migration tool in a CI/CD pipeline?
- Java.DBMigrationTools.How do you undo a Flyway migration?
- Java.DBMigrationTools.What is a Flyway baseline?
- Java.DBMigrationTools.Can you use Java code to write Flyway migrations?
- Java.DBMigrationTools.What is flyway.migrate() used for?
- Java.DBMigrationTools.What happens if you rename a Flyway migration file?
- Java.DBMigrationTools.What’s the difference between versioned and repeatable migrations?
- Java.DBMigrationTools.What is the flyway_schema_history table?
- Java.DBMigrationTools.What naming convention does Flyway use for migration files?
- Java.DBMigrationTools.What is Flyway?
- Java.DBMigrationTools.What is a logicalFilePath?
- Java.DBMigrationTools.What is the purpose of include and includeAll in changelogs?
- Java.DBMigrationTools.How do you apply a Liquibase migration from the command line?
Categories
- Aptana
- Azure
- C#
- DataSnap
- DBExpress
- Delphi
- Delphi и сети
- Delphi. Язык программирования
- ExtJS
- FastReport
- FireDAC
- FireMonkey
- GIT
- ICS
- IDE
- IIS
- Indy
- InnoSetup
- javascript
- jQuery
- JSON
- LiveBindings
- MSHTML
- MySQL
- PHP
- REST
- Ribbons
- SMS
- SQL инструкции
- SVN
- TRichView
- UniGui
- WebBroker
- WinAPI
- Windows
- Алгоритмы
- Без рубрики
- Деревья
- Ищу ответ
- Компонентостроение
- Мои компоненты
- Начальный уровень
- Обработка исключений
- Парсинг
- Потоки(Threads)
- Регулярные выражения
- Тестирование приложений