codility1 [Swift3 / 알고리즘] Binary Gap Codility의 Lesson 1 Binary Gap 문제 풀이입니다. 하루 1 알고리즘을 목표로.. 123456789101112131415161718192021222324public func solution(_ N : Int) -> Int { var cnt: Int = 0 var maxCnt: Int = 0 var check: Bool = false let str = String(N, radix: 2) for i in 0.. maxCnt) { maxCnt = cnt } check = true cnt = 0 }else { if(check) { cnt += 1 } } } return maxCnt}Colored by Color Scriptercs 2017. 10. 17. 이전 1 다음