We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e32032b commit 8233d01Copy full SHA for 8233d01
4.go
@@ -0,0 +1,32 @@
1
+package main
2
+
3
+import (
4
+ "fmt"
5
+ "strconv"
6
+)
7
8
+func main() {
9
+ max := -1
10
+ for i := 999; i >= 100; i-- {
11
+ for j := 999; j >= 100; j-- {
12
+ mult := i * j
13
+ if isPalindrome(mult) {
14
+ if mult > max {
15
+ max = mult
16
+ }
17
18
19
20
+ fmt.Println(max)
21
+}
22
23
+func isPalindrome(num int) bool {
24
+ chars := strconv.Itoa(num)
25
+ count := len(chars)
26
+ for ind := range chars {
27
+ if chars[ind] != chars[count-ind-1] {
28
+ return false
29
30
31
+ return true
32
0 commit comments