/android-kotlin-basics-two-sum

The Two Sum problem asks to find the indices of two elements in an array that add up to a given target sum. The algorithm implemented here uses a hash table to keep track of the elements in the array, allowing for a time complexity of O(n) instead of the O(n^2) that would result from a brute-force search.

Primary LanguageKotlin

android-kotlin-basics-two-sum

The Two Sum problem asks to find the indices of two elements in an array that add up to a given target sum. The algorithm implemented here uses a hash table to keep track of the elements in the array, allowing for a time complexity of O(n) instead of the O(n^2) that would result from a brute-force search.