Sha256: bf93b6be65697b89e1d1f372fd6af7bf69c7ea9550dfcb99e34637f40e621ebd
Contents?: true
Size: 711 Bytes
Versions: 188
Compression:
Stored size: 711 Bytes
Contents
struct Series { var numberString = "" init(_ numString: String) { self.numberString = numString } func slices(_ chunkSize: Int) -> [[Int]] { var numberStringArray = Array(numberString.characters).map { Int("\($0)") ?? 0 } let count = numberStringArray.count var start = 0 var end = chunkSize var tempArrayReturn = [[Int]]() let enumarated = (0..<(count)).enumerated() for (_, _) in enumarated where end < (count + 1) { let tempArray = Array(numberStringArray[start ..< end]) tempArrayReturn.append(tempArray) start += 1 end += 1 } return tempArrayReturn } }
Version data entries
188 entries across 188 versions & 1 rubygems