Skip to content

Commit 1f0138b

Browse files
committed
go fmt
1 parent 624b094 commit 1f0138b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/0001_two_sum/twosum.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ func twoSum(nums []int, target int) []int {
3636
// brute force
3737
// Time complexity: O(n^2)
3838
// Space complexity: O(1)
39-
func twoSum1(nums []int, target int) []int{
39+
func twoSum1(nums []int, target int) []int {
4040
for i, j := range nums {
41-
for k := i+1; k < len(nums); k++ {
42-
if nums[k] + j == target {
41+
for k := i + 1; k < len(nums); k++ {
42+
if nums[k]+j == target {
4343
return []int{i, k}
4444
}
4545
}

src/0001_two_sum/twosum_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import (
88
func TestTwoSum(t *testing.T) {
99
nums := []int{2, 7, 11, 15}
1010

11-
funcs := []func ([]int, int) []int {twoSum, twoSum1}
11+
funcs := []func([]int, int) []int{twoSum, twoSum1}
1212

1313
for _, testFunc := range funcs {
1414
if res := testFunc(nums, 9); !reflect.DeepEqual(res, []int{0, 1}) {
1515
t.Error("Failed, two sum")
1616
}
17-
17+
1818
if res := testFunc(nums, 6); !reflect.DeepEqual(res, []int{}) {
1919
t.Error("Failed, two sum")
2020
}

src/0713_subarray_product_less_than_k/spltk_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ func TestNumSubArrayProductLessThanK(t *testing.T) {
1212
ks := []int{100, 0, 100}
1313
expected := []int{8, 0, 4}
1414

15-
functions := []func([]int, int)int{
15+
functions := []func([]int, int) int{
1616
numSubArrayProductLessThanK,
1717
numSubArrayProductLessThanK2,
1818
}

0 commit comments

Comments
 (0)