solve_1.go 747 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package main
  2. import (
  3. "fmt"
  4. "os"
  5. "strconv"
  6. "strings"
  7. )
  8. func is_palindrome(id int) bool {
  9. fmt.Printf("analyzing %v\n", id)
  10. return true
  11. }
  12. func count_palindroms(lb, ub int) int{
  13. fmt.Printf("counting palindroms %v until %v\n", lb, ub)
  14. for i:=lb; i <= ub; i++ {
  15. is_palindrome(i)
  16. }
  17. return 0
  18. }
  19. func main() {
  20. fmt.Println("Advent of Code 2025 - Day 2 - Part 1")
  21. f, _ := os.ReadFile("2/test")
  22. fmt.Println(string(f))
  23. l := strings.Split(string(f), ",")
  24. var ranges []string
  25. var lower_bound int
  26. var upper_bound int
  27. for _,value := range l {
  28. ranges = strings.Split(value,"-")
  29. lower_bound, _ = strconv.Atoi(ranges[0])
  30. upper_bound, _ = strconv.Atoi(ranges[1])
  31. count_palindroms(lower_bound, upper_bound)
  32. fmt.Println("****")
  33. }
  34. }