daily pastebin goal
7%
SHARE
TWEET

Untitled

a guest Jun 6th, 2018 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package main
  2.  
  3. import "fmt"
  4.  
  5. func main() {
  6.     var(
  7.         mainString = "Main str "
  8.         already = map[int32]bool{}
  9.         flagAlready bool = false
  10.     )
  11.     for _, value := range mainString{
  12.         if _, ok := already[value]; ok {
  13.             flagAlready = true
  14.             break
  15.         } else { already[value] = true }
  16.     }
  17.     fmt.Printf("%t\n", flagAlready)
  18. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top