---
title: "Discussion on \"[Codility/Swift] lesson 1 : BinaryGap\" | Hashnode"
description: "Discussion on \"[Codility/Swift] lesson 1 : BinaryGap\". Task description\n\nSolution\nFirst, I convert the input N to a binary string using String(value, radix: 2). Then, in a for loop, I check each character of the binary string. During the loop, if the character is \"0\", I add 1 to the tmp variable for temp..."
url: "https://hashnode.com/posts/codilityswift-lesson-1-binarygap/6697fbd8c9cc3c4cbde283d7"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [\[Codility/Swift\] lesson 1 : BinaryGap](https://studio-pendant.hashnode.dev/codilityswift-lesson-1-binarygap?utm_source=hashnode&utm_medium=feed)

Task description Solution First, I convert the input N to a binary string using String(value, radix: 2). Then, in a for loop, I check each character of the binary string. During the loop, if the character is "0", I add 1 to the tmp variable for temp...

Jul 17, 2024 · 1 min read · studio-pendant.hashnode.dev  
Read the article

-   [#codility](https://hashnode.com/tag/codility)
-   [#interview](https://hashnode.com/tag/interview)
-   [#swift](https://hashnode.com/tag/swift)

## Written by

[Donghan Kim](https://hashnode.com/@pendantK)

@pendantK · Suwon-si, Korea

  
[View profile](https://hashnode.com/@pendantK)

Web / iOS / Flutter Developer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
