Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "fmt"
const __RANSOM_NOTE_YES__ = "Yes"
const __RANSOM_NOTE_NO__ = "No"

func checkMagazineCompute(magazine []string, note []string) bool {
func checkMagazineCompute(magazine, note []string) bool {
dictionary := make(map[string]int)

for _, word := range magazine {
Expand All @@ -27,22 +27,22 @@ func checkMagazineCompute(magazine []string, note []string) bool {
return true
}

func checkMagazineText(magazine []string, note []string) string {
func checkMagazineText(magazine, note []string) string {
if checkMagazineCompute(magazine, note) {
return __RANSOM_NOTE_YES__
}

return __RANSOM_NOTE_NO__
}

func checkMagazine(magazine []string, note []string) {
func checkMagazine(magazine, note []string) {
fmt.Println(checkMagazineText(magazine, note))
}

func CheckMagazineText(magazine []string, note []string) string {
func CheckMagazineText(magazine, note []string) string {
return checkMagazineText(magazine, note)
}

func CheckMagazine(magazine []string, note []string) {
func CheckMagazine(magazine, note []string) {
checkMagazine(magazine, note)
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ package hackerrank
const __TWO_STRINGS_YES__ = "Yes"
const __TWO_STRINGS_NO__ = "No"

func twoStringsCompute(s1 string, s2 string) bool {
func twoStringsCompute(s1, s2 string) bool {
for _, letter := range s1 {
for _, n := range s2 {
if letter == n {
Expand All @@ -20,14 +20,14 @@ func twoStringsCompute(s1 string, s2 string) bool {
return false
}

func twoStrings(s1 string, s2 string) string {
func twoStrings(s1, s2 string) string {
if twoStringsCompute(s1, s2) {
return __TWO_STRINGS_YES__
}

return __TWO_STRINGS_NO__
}

func TwoStrings(s1 string, s2 string) string {
func TwoStrings(s1, s2 string) string {
return twoStrings(s1, s2)
}
2 changes: 1 addition & 1 deletion exercises/hackerrank/warmup/solveMeFirst.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package hackerrank

import "gon.cl/algorithms/utils/log"

func SolveMeFirst(a int, b int) int {
func SolveMeFirst(a, b int) int {

var answer = a + b

Expand Down
2 changes: 1 addition & 1 deletion exercises/projecteuler/helpers/divisors.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func PrimeFactors(target int) (factors []int, cycles int) {
return
}

func AreAmicables(a int, b int, cache map[int]int) bool {
func AreAmicables(a, b int, cache map[int]int) bool {

if a == b || a <= 1 || b <= 1 {
return false
Expand Down
2 changes: 1 addition & 1 deletion exercises/projecteuler/helpers/matrix.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package helpers

func Matrix(m int, n int, init int) [][]int {
func Matrix(m, n, init int) [][]int {
var matrix [][]int

for range m {
Expand Down
2 changes: 1 addition & 1 deletion exercises/projecteuler/problem0004.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"gon.cl/algorithms/utils/log"
)

func Problem0004(bottom int, top int) int {
func Problem0004(bottom, top int) int {
var i int
var j int
var foundi int
Expand Down
2 changes: 1 addition & 1 deletion exercises/projecteuler/problem0005_brute_force.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"gon.cl/algorithms/utils/log"
)

func Problem0005BruteForce(bottom int, top int, startFrom int) int {
func Problem0005BruteForce(bottom, top, startFrom int) int {

var answer int
found := false
Expand Down
2 changes: 1 addition & 1 deletion exercises/projecteuler/problem0009.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"gon.cl/algorithms/utils/log"
)

func IsPythagoreanTriplet(a int, b int, c int) bool {
func IsPythagoreanTriplet(a, b, c int) bool {
return a < b && b < c && math.Pow(float64(a), 2)+math.Pow(float64(b), 2) == math.Pow(float64(c), 2)
}

Expand Down
2 changes: 1 addition & 1 deletion exercises/projecteuler/problem0010.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"gon.cl/algorithms/utils/log"
)

func Problem0010(bottom int, top int) int {
func Problem0010(bottom, top int) int {

var answer int

Expand Down
2 changes: 1 addition & 1 deletion exercises/projecteuler/problem0014.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"gon.cl/algorithms/utils/log"
)

func Problem0014(bottom int, top int) int {
func Problem0014(bottom, top int) int {
var answer int
var maxSequence []int

Expand Down
2 changes: 1 addition & 1 deletion exercises/projecteuler/problem0016.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
const __NUMERIC_BASE__ = 10
const __SPLIT_SEPARATOR__ = ""

func Problem0016(base int, exponent int) string {
func Problem0016(base, exponent int) string {

power := new(big.Int).Exp(big.NewInt(int64(base)), big.NewInt(int64(exponent)), nil)

Expand Down
2 changes: 1 addition & 1 deletion exercises/projecteuler/problem0017.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"gon.cl/algorithms/utils/log"
)

func Problem0017(init int, last int) int {
func Problem0017(init, last int) int {

var acum int

Expand Down
2 changes: 1 addition & 1 deletion exercises/projecteuler/problem0021.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"gon.cl/algorithms/utils/log"
)

func Problem0021(start int, limit int) int {
func Problem0021(start, limit int) int {

cache := map[int]int{}
amicables := map[int]int{}
Expand Down
2 changes: 1 addition & 1 deletion exercises/projecteuler/problem0023.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"gon.cl/algorithms/utils/log"
)

func Problem0023(underLimit int, superLimit int) int {
func Problem0023(underLimit, superLimit int) int {

var abundantNumberList = []int{}

Expand Down