Abderrahmane Faiz 3 هفته پیش
والد
کامیت
0c4a3bab3b
1فایلهای تغییر یافته به همراه40 افزوده شده و 0 حذف شده
  1. 40 0
      2/solve_1.go

+ 40 - 0
2/solve_1.go

@@ -0,0 +1,40 @@
+package main
+
+import (
+	"fmt"
+	"os"
+	"strconv"
+	"strings"
+)
+
+func is_palindrome(id int) bool {
+	fmt.Printf("analyzing %v\n", id)
+	return true
+}
+
+func count_palindroms(lb, ub int) int{
+	fmt.Printf("counting palindroms %v until %v\n", lb, ub)
+	for i:=lb; i <= ub; i++ {
+		is_palindrome(i)
+	}
+	return 0
+}
+
+
+func main() {
+	fmt.Println("Advent of Code 2025 - Day 2 - Part 1")
+	f, _ := os.ReadFile("2/test")
+	fmt.Println(string(f))
+	l := strings.Split(string(f), ",")
+	var ranges []string
+	var lower_bound int
+	var upper_bound int
+	for _,value := range l {
+		ranges = strings.Split(value,"-")
+		lower_bound, _ = strconv.Atoi(ranges[0])
+		upper_bound, _ = strconv.Atoi(ranges[1])
+		count_palindroms(lower_bound, upper_bound)
+		fmt.Println("****")
+	}
+	
+}