<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: kingsley Goodluck</title>
    <description>The latest articles on DEV Community by kingsley Goodluck (@itechsuite).</description>
    <link>https://dev.to/itechsuite</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F520014%2Fe520a823-26a0-4cf6-b025-d2adf4bd0707.jpeg</url>
      <title>DEV Community: kingsley Goodluck</title>
      <link>https://dev.to/itechsuite</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/itechsuite"/>
    <language>en</language>
    <item>
      <title>Codility Test Question</title>
      <dc:creator>kingsley Goodluck</dc:creator>
      <pubDate>Fri, 12 Aug 2022 00:34:00 +0000</pubDate>
      <link>https://dev.to/itechsuite/codility-test-question-3ib7</link>
      <guid>https://dev.to/itechsuite/codility-test-question-3ib7</guid>
      <description>&lt;p&gt;Hi guys, i've been struggling to get to complete this codility question. &lt;br&gt;
**A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N.&lt;/p&gt;

&lt;p&gt;For example, number 9 has binary representation 1001 and contains a binary gap of length 2. The number 529 has binary representation 1000010001 and contains two binary gaps: one of length 4 and one of length 3. The number 20 has binary representation 10100 and contains one binary gap of length 1. The number 15 has binary representation 1111 and has no binary gaps. The number 32 has binary representation 100000 and has no binary gaps.&lt;/p&gt;

&lt;p&gt;Write a function:&lt;/p&gt;

&lt;p&gt;function solution(N);&lt;/p&gt;

&lt;p&gt;that, given a positive integer N, returns the length of its longest binary gap. The function should return 0 if N doesn't contain a binary gap.&lt;/p&gt;

&lt;p&gt;For example, given N = 1041 the function should return 5, because N has binary representation 10000010001 and so its longest binary gap is of length 5. Given N = 32 the function should return 0, because N has binary representation '100000' and thus no binary gaps.&lt;/p&gt;

&lt;p&gt;Write an efficient algorithm for the following assumptions:&lt;/p&gt;

&lt;p&gt;N is an integer within the range [1..2,147,483,647].**&lt;/p&gt;

&lt;p&gt;After series of failing, i finally came up with a solution. wont lie, it was frustrating at first, even the sample code i got online didn't work. &lt;/p&gt;

&lt;p&gt;well i finally found a way to solve the test. &lt;/p&gt;

&lt;p&gt;Below you'll find my code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function solution(N) {
  // write your code in JavaScript (Node.js 8.9.4)
  let base = N.toString(2);
  let result = 0; //initialize to 0
  let t = 0;
  let array = [];

  for (let n in base) {
    let b = base[n]; 
    if (b == 1) {
      if (t &amp;gt;= 0) {
        array.push(result);
        result = 0;
        t = 0;
      } else {
        t += 1;
      }
    } else {
      result = result + 1;
    }
  }

  return array.reduce((a, b) =&amp;gt; Math.max(a, b), -Infinity);
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you're a software developer, i'll highly recommend you sign up on codility and have yourself some code challenges. You  might never know logical you are in solving problems until you try most of this test. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>first post</title>
      <dc:creator>kingsley Goodluck</dc:creator>
      <pubDate>Tue, 09 Aug 2022 21:18:53 +0000</pubDate>
      <link>https://dev.to/itechsuite/first-post-30pg</link>
      <guid>https://dev.to/itechsuite/first-post-30pg</guid>
      <description>&lt;p&gt;Growing to be a professional software developer is a process that knows no end. You either start or get stuck planning. &lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
