Skip to content

Commit

Permalink
remove faulty algo solution
Browse files Browse the repository at this point in the history
  • Loading branch information
catdevman committed Mar 16, 2024
1 parent 8f47064 commit 1f871e9
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions go/twosum/twosum.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,5 @@ package twosum

func TwoSum(nums []int, target int) []int {
out := []int{}
for i := 0; i < len(nums)-1; i++ {
if nums[i]+nums[i+1] == target {
out = append(out, i)
out = append(out, i+1)
break
}
}
return out
}

0 comments on commit 1f871e9

Please sign in to comment.