Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 165c57e

Browse files
committed
Explanation for Two Sum problem solutions
1 parent bf9bea7 commit 165c57e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ var twoSum = function (nums, target) {
6363

6464
To improve the first solution we can improve time complexity by sacrificing space and creating an object and storing the difference between the index of nums array and the target value.
6565

66+
The space complexity for this solution is O(N).
67+
68+
The time complexity for this solution is O(N).
69+
6670
### Solution 2
6771

6872
```js

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /