-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: pass slice instead of full string
- Loading branch information
Showing
4 changed files
with
16 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,9 @@ | ||
package main | ||
|
||
import "strings" | ||
|
||
func part1(input string) any { | ||
for _, line := range strings.Split(input, "\n") { | ||
_ = line | ||
} | ||
|
||
func part1(input []string) any { | ||
return nil | ||
} | ||
|
||
func part2(input string) any { | ||
for _, line := range strings.Split(input, "\n") { | ||
_ = line | ||
} | ||
|
||
func part2(input []string) any { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
package main | ||
|
||
import "testing" | ||
import ( | ||
"strings" | ||
"testing" | ||
) | ||
|
||
func BenchmarkPart1(b *testing.B) { | ||
for i := 0; i < b.N; i++ { | ||
part1(input) | ||
part1(strings.Split(input, "\n")) | ||
} | ||
} | ||
|
||
func BenchmarkPart2(b *testing.B) { | ||
for i := 0; i < b.N; i++ { | ||
part2(input) | ||
part2(strings.Split(input, "\n")) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters