Skip to main content
Commonmark migration
Source Link

#Swift 3, 96 93 bytes

Swift 3, 96 93 bytes

import Cocoa
func c(n:Int,s:Int,e:Int){print((s...e).filter{"\($0)".contains("\(n)")}.count)}

Edit 1:

Saved 3 bytes by using shorthand parameters

#Swift 3, 96 93 bytes

import Cocoa
func c(n:Int,s:Int,e:Int){print((s...e).filter{"\($0)".contains("\(n)")}.count)}

Edit 1:

Saved 3 bytes by using shorthand parameters

Swift 3, 96 93 bytes

import Cocoa
func c(n:Int,s:Int,e:Int){print((s...e).filter{"\($0)".contains("\(n)")}.count)}

Edit 1:

Saved 3 bytes by using shorthand parameters

added 69 characters in body
Source Link
Otávio
  • 181
  • 1
  • 7

#Swift 3, 9696 93 bytes

import Cocoa
func c(n:Int,s:Int,e:Int){print((s...e).filter{a in"\"\(a$0)".contains("\(n)")}.count)}

Edit 1:

Saved 3 bytes by using shorthand parameters

#Swift 3, 96 bytes

import Cocoa
func c(n:Int,s:Int,e:Int){print((s...e).filter{a in"\(a)".contains("\(n)")}.count)}

#Swift 3, 96 93 bytes

import Cocoa
func c(n:Int,s:Int,e:Int){print((s...e).filter{"\($0)".contains("\(n)")}.count)}

Edit 1:

Saved 3 bytes by using shorthand parameters

Writte bytes with small letters
Source Link
Otávio
  • 181
  • 1
  • 7

#Swift 3, 96 Bytesbytes

import Cocoa
func c(n:Int,s:Int,e:Int){print((s...e).filter{a in"\(a)".contains("\(n)")}.count)}

#Swift 3, 96 Bytes

import Cocoa
func c(n:Int,s:Int,e:Int){print((s...e).filter{a in"\(a)".contains("\(n)")}.count)}

#Swift 3, 96 bytes

import Cocoa
func c(n:Int,s:Int,e:Int){print((s...e).filter{a in"\(a)".contains("\(n)")}.count)}
Source Link
Otávio
  • 181
  • 1
  • 7
Loading