From 38b3a132539dc06061e4ea94288d1230bb7b65b9 Mon Sep 17 00:00:00 2001 From: "go-interview-practice-bot[bot]" <230190823+go-interview-practice-bot[bot]@users.noreply.github.com> Date: Wed, 5 Nov 2025 20:03:56 +0000 Subject: [PATCH] Add solution for Challenge 2 --- .../es-codigo/solution-template.go | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 challenge-2/submissions/es-codigo/solution-template.go diff --git a/challenge-2/submissions/es-codigo/solution-template.go b/challenge-2/submissions/es-codigo/solution-template.go new file mode 100644 index 00000000..621310b6 --- /dev/null +++ b/challenge-2/submissions/es-codigo/solution-template.go @@ -0,0 +1,32 @@ +package main + +import ( + "bufio" + "fmt" + "os" +) + +func main() { + // Read input from standard input + scanner := bufio.NewScanner(os.Stdin) + if scanner.Scan() { + input := scanner.Text() + + // Call the ReverseString function + output := ReverseString(input) + + // Print the result + fmt.Println(output) + } +} + +// ReverseString returns the reversed string of s. +func ReverseString(s string) string { + rs := "" + + for _, char := range s { + rs = string(char) + rs + } + + return rs +}