Sha256: 95ab4b1f32dfa3716df4ae111891660b14d41f2b4d8169cd2ba83c8a8dc5150c
Contents?: true
Size: 746 Bytes
Versions: 130
Compression:
Stored size: 746 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 { if end < count+1 { let tempArray = Array(numberStringArray[start ..< end]) tempArrayReturn.append(tempArray) start += 1 end += 1 } } return tempArrayReturn } }
Version data entries
130 entries across 130 versions & 1 rubygems