Advertisement
Guest User

Untitled

a guest
Nov 1st, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.49 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5.     "math/big"
  6. )
  7.  
  8. func main() {
  9.     cur := big.NewInt(1)
  10.     curSq := big.NewInt(1)
  11.     var curSqLen int
  12.     for {
  13.         curSqStr := curSq.String()
  14.         curSqLen = len(curSqStr)
  15.         if curSqLen > 10 {
  16.             break
  17.         }
  18.         if curSqLen == 10 {
  19.             setOfDigits := map[byte]bool{}
  20.             for i := 0; i < 10; i++ {
  21.                 setOfDigits[curSqStr[i]] = true
  22.             }
  23.             if len(setOfDigits) == 10 {
  24.                 fmt.Println(curSqStr)
  25.             }
  26.         }
  27.         cur.Add(cur, big.NewInt(1))
  28.         curSq.Mul(cur, cur)
  29.     }
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement