<?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: Arth </title>
    <description>The latest articles on DEV Community by Arth  (@user64bit).</description>
    <link>https://dev.to/user64bit</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%2F831591%2Fc5f36096-28e1-4794-b749-17c225b20d83.png</url>
      <title>DEV Community: Arth </title>
      <link>https://dev.to/user64bit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/user64bit"/>
    <language>en</language>
    <item>
      <title>[Boost]</title>
      <dc:creator>Arth </dc:creator>
      <pubDate>Sat, 07 Feb 2026 16:54:51 +0000</pubDate>
      <link>https://dev.to/user64bit/-2491</link>
      <guid>https://dev.to/user64bit/-2491</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/user64bit" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F831591%2Fc5f36096-28e1-4794-b749-17c225b20d83.png" alt="user64bit"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/user64bit/i-built-devdna-a-tool-that-turns-github-profiles-into-developer-personality-reports-using-11ob" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;I Built DevDNA — A Tool That Turns GitHub Profiles Into Developer Personality Reports (Using Copilot CLI)&lt;/h2&gt;
      &lt;h3&gt;Arth  ・ Feb 7&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#devchallenge&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#githubchallenge&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#cli&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#githubcopilot&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>devchallenge</category>
      <category>githubchallenge</category>
      <category>cli</category>
      <category>githubcopilot</category>
    </item>
    <item>
      <title>I Built DevDNA — A Tool That Turns GitHub Profiles Into Developer Personality Reports (Using Copilot CLI)</title>
      <dc:creator>Arth </dc:creator>
      <pubDate>Sat, 07 Feb 2026 16:54:27 +0000</pubDate>
      <link>https://dev.to/user64bit/i-built-devdna-a-tool-that-turns-github-profiles-into-developer-personality-reports-using-11ob</link>
      <guid>https://dev.to/user64bit/i-built-devdna-a-tool-that-turns-github-profiles-into-developer-personality-reports-using-11ob</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/github-2026-01-21"&gt;GitHub Copilot CLI Challenge&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/user-64bit/dev-dna" rel="noopener noreferrer"&gt;Github Repo&lt;/a&gt;&lt;br&gt;
&lt;a href="https://dev-dna-theta.vercel.app/" rel="noopener noreferrer"&gt;Live&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;I built &lt;strong&gt;DevDNA&lt;/strong&gt; — a web app that analyzes a GitHub profile and turns it into a developer personality report.&lt;/p&gt;

&lt;p&gt;Instead of just showing stats like repos, commits, and languages, the idea was to answer a more interesting question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;What does your GitHub say about the kind of developer you are?&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;DevDNA looks at public GitHub data and generates a profile experience that feels more like an intelligence report than a dashboard. It tries to surface patterns like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Coding rhythm&lt;/li&gt;
&lt;li&gt;Language dominance&lt;/li&gt;
&lt;li&gt;Activity behavior&lt;/li&gt;
&lt;li&gt;Contribution style&lt;/li&gt;
&lt;li&gt;A “Developer Archetype” (the dramatic centerpiece 😄)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal wasn’t to clone GitHub or build another analytics tool. I wanted something that feels:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;personal&lt;/li&gt;
&lt;li&gt;visual&lt;/li&gt;
&lt;li&gt;slightly cinematic&lt;/li&gt;
&lt;li&gt;and very dev-centric&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You enter a username, and the system “analyzes” it and reveals a personality-style breakdown.&lt;/p&gt;

&lt;p&gt;This project was also a personal experiment in &lt;strong&gt;AI-native development&lt;/strong&gt; — building fast, iterating faster, and treating Copilot CLI as a real collaborator.&lt;/p&gt;




&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Project link:&lt;/strong&gt;&lt;br&gt;
👉 &lt;a href="https://drive.google.com/file/d/1KY_EyGzYmQXx7-eZ5w3-kenLvIbb5tlu/view?usp=sharing" rel="noopener noreferrer"&gt;DevDNA Demo&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Try with usernames like:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;torvalds&lt;/li&gt;
&lt;li&gt;gaearon&lt;/li&gt;
&lt;li&gt;sindresorhus&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;What happens:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Landing page with a subtle “digital DNA” background&lt;/li&gt;
&lt;li&gt;Enter a GitHub username&lt;/li&gt;
&lt;li&gt;A short analysis sequence runs&lt;/li&gt;
&lt;li&gt;Then the full DevDNA report appears:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Identity header (avatar, bio, stats)&lt;/li&gt;
&lt;li&gt;Developer Archetype (main highlight)&lt;/li&gt;
&lt;li&gt;Insight cards&lt;/li&gt;
&lt;li&gt;Language/activity visualizations&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  My Experience with GitHub Copilot CLI
&lt;/h2&gt;

&lt;p&gt;This project was built with a very intentional mindset:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“What happens if I treat Copilot CLI like a development partner instead of just autocomplete?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And honestly, that changed everything.&lt;/p&gt;

&lt;h3&gt;
  
  
  How I used Copilot CLI
&lt;/h3&gt;

&lt;p&gt;I used Copilot CLI throughout the process to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scaffold components quickly&lt;/li&gt;
&lt;li&gt;Structure the result page layout&lt;/li&gt;
&lt;li&gt;Generate API integration logic&lt;/li&gt;
&lt;li&gt;Iterate on UI states and transitions&lt;/li&gt;
&lt;li&gt;Refine animations and interaction flows&lt;/li&gt;
&lt;li&gt;Experiment rapidly without breaking momentum&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of switching between docs, StackOverflow, and trial-and-error, I could stay in flow and build continuously.&lt;/p&gt;

&lt;p&gt;The most interesting part was using it during the “idea → implementation” phase:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;I could describe what I wanted&lt;/li&gt;
&lt;li&gt;Refine it step by step&lt;/li&gt;
&lt;li&gt;And evolve the product visually and structurally in real time&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It felt less like coding line-by-line and more like &lt;strong&gt;directing the build&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Where Copilot CLI helped the most
&lt;/h3&gt;

&lt;p&gt;The biggest wins were:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rapid prototyping of UI sections&lt;/li&gt;
&lt;li&gt;Structuring complex pages (especially the result screen)&lt;/li&gt;
&lt;li&gt;Iterating on multiple visual ideas quickly&lt;/li&gt;
&lt;li&gt;Handling repetitive setup and wiring&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That speed made it possible to focus on the experience:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How the analysis should feel&lt;/li&gt;
&lt;li&gt;What the reveal moment should look like&lt;/li&gt;
&lt;li&gt;How to present identity instead of just data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of getting stuck in boilerplate.&lt;/p&gt;

&lt;h3&gt;
  
  
  What surprised me
&lt;/h3&gt;

&lt;p&gt;The biggest shift wasn’t technical — it was mental.&lt;/p&gt;

&lt;p&gt;I found myself thinking more about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;product feel&lt;/li&gt;
&lt;li&gt;user experience&lt;/li&gt;
&lt;li&gt;narrative&lt;/li&gt;
&lt;li&gt;visual identity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And less about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;syntax&lt;/li&gt;
&lt;li&gt;small implementation details&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Copilot CLI helped remove friction, which made experimentation much easier. I could try things, change direction, and push ideas further without the usual overhead.&lt;/p&gt;

&lt;p&gt;This project ended up being a mix of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;curiosity&lt;/li&gt;
&lt;li&gt;fast iteration&lt;/li&gt;
&lt;li&gt;and a lot of “what if I try this next?”&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And that’s probably what made it fun to build.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why I built DevDNA
&lt;/h2&gt;

&lt;p&gt;I’ve always found GitHub profiles interesting, but they mostly show numbers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;repos&lt;/li&gt;
&lt;li&gt;commits&lt;/li&gt;
&lt;li&gt;followers&lt;/li&gt;
&lt;li&gt;stars&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They don’t tell the story.&lt;/p&gt;

&lt;p&gt;But if you look at patterns — languages, activity, focus areas — you can start to see the developer behind the code.&lt;/p&gt;

&lt;p&gt;DevDNA is basically an attempt to turn:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;raw GitHub data → personality signals&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Not scientifically accurate.&lt;br&gt;
Not meant to judge.&lt;/p&gt;

&lt;p&gt;Just a fun, thoughtful way to look at how people build.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This challenge ended up being more than just “build something with Copilot CLI”.&lt;/p&gt;

&lt;p&gt;It became an experiment in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;fast creation&lt;/li&gt;
&lt;li&gt;AI-assisted workflows&lt;/li&gt;
&lt;li&gt;and building something visual and expressive in a short time&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I wanted to make something that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;looks cool&lt;/li&gt;
&lt;li&gt;feels alive&lt;/li&gt;
&lt;li&gt;and makes developers curious to try it on their own profile&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If someone runs their username and thinks:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Okay… that’s actually kind of accurate.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then I consider it a success 😄&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>githubchallenge</category>
      <category>cli</category>
      <category>githubcopilot</category>
    </item>
    <item>
      <title>Sliding Window Technique</title>
      <dc:creator>Arth </dc:creator>
      <pubDate>Tue, 10 May 2022 18:24:24 +0000</pubDate>
      <link>https://dev.to/user64bit/sliding-window-technique-5aha</link>
      <guid>https://dev.to/user64bit/sliding-window-technique-5aha</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;The sliding window technique is used for reducing some redundant calculations that slow down the program. like it can reduce time complexity from O(n^2) to O(n) with O(1) space complexity.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why use it?
&lt;/h2&gt;

&lt;p&gt;First of all it reduce time coplexity and also with O(1) space complexity. so let's understand with Example..&lt;br&gt;
 So we want to find maximum sum of k consecutive integer from array, so brute force would look like this for k=5,&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include&amp;lt;iostream&amp;gt;
#include&amp;lt;vector&amp;gt;
using namespace std;
int main(){
    vector&amp;lt;int&amp;gt; arr = {5,2,6,7,7,3,2,1,3,9};
    int final_max = 0;
    for(int i=0;i&amp;lt;arr.size()-5;i++){
        int temp_max = 0;
        for(int j=i;j&amp;lt;i+5;j++){
            temp_max += arr[j];
        }
        if(temp_max&amp;gt;final_max){
            final_max = temp_max;
        }
    }
    cout &amp;lt;&amp;lt; final_max &amp;lt;&amp;lt; endl;
    return 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;But time complexity of the above program is O(nk)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Brute Force Approach&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mrv8-N1j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vit2uey51n6p1ct6lm7p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mrv8-N1j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vit2uey51n6p1ct6lm7p.png" alt="Image description" width="599" height="482"&gt;&lt;/a&gt;&lt;br&gt;
As per we can see in the above image brute approach checks every pattern of k length(here k=5). if you compare the above code with this image you will understand it.&lt;/p&gt;

&lt;p&gt;here k=5 so it won't make too much difference in O(n) and O(nk) but what if k is too big. then it will impact the running time of the program, so what to do now? can we implement the above code to O(n)?&lt;/p&gt;

&lt;p&gt;The answer is YES!! , with the use of the sliding window, we can reduce the time complexity of the above code O(n). &lt;/p&gt;
&lt;h2&gt;
  
  
  How does Sliding Window Works?
&lt;/h2&gt;

&lt;p&gt;So let's see how sliding window works.&lt;br&gt;
let me give you simple visual with small array,&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{5,2,6,7,7,3,2,1,3,9}
for k=3 (because k=5 is too much to write)
{5,2,6} --&amp;gt; first 3 elements
{2,6,7} --&amp;gt; remove 5 and add 7 
{6,7,7} --&amp;gt; remove 2 and add 7
{7,7,3} --&amp;gt; remove 6 and add 3
{7,3,2} --&amp;gt; remove 7 and add 2
{3,2,1} --&amp;gt; remove 7 and add 1
{2,1,3} --&amp;gt; remove 3 and add 3
{1,3,9} --&amp;gt; remove 2 and add 9
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;let's understand with second example,&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; {5, 7, 1, 4, 3, 6, 2, 9, 2}
 k=5
 {5,7,1,4,3} --&amp;gt; first 5
 {7,1,4,3,6} --&amp;gt; remove 5 and add 6
 and so on.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8jpmF8_O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/16ehzdmqngpluey1dhiz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8jpmF8_O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/16ehzdmqngpluey1dhiz.png" alt="Image description" width="653" height="152"&gt;&lt;/a&gt;&lt;br&gt;
As we can see in the above image it moves one step at one time. so this is how actually it works.&lt;/p&gt;
&lt;h2&gt;
  
  
  Let's Code
&lt;/h2&gt;

&lt;p&gt;Code for a maximum sum of k consecutive integer from the array, using the sliding window technique.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include&amp;lt;iostream&amp;gt;
#include&amp;lt;vector&amp;gt;
using namespace std;
int sum_of_k_ele(vector&amp;lt;int&amp;gt; arr,int k){
    int sum = 0;
    for(int i=0;i&amp;lt;k;i++){
        sum += arr[i];
    }
    return sum;
}
int main(){
    vector&amp;lt;int&amp;gt; arr = {5,2,6,7,7,3,2,1,3,9};
    int k=3;
    // below function will be used only once 
    // for finding sum of first k digits
    int final_sum = sum_of_k_ele(arr,k);

    int temp_sum = final_sum;
    for (int i=k;i&amp;lt;arr.size();i++){
        temp_sum = temp_sum - arr[i-k];
        temp_sum = temp_sum + arr[i];
        if(temp_sum&amp;gt;final_sum){
            final_sum = temp_sum;
        } 
    }
    cout &amp;lt;&amp;lt; final_sum &amp;lt;&amp;lt; endl;

    return 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  When to use?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;When you are looking for a subrange in a given string or array-like highest or smallest value or targeted value.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;it involves data structure which is iterable like string or array.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;when there can be brute force solution with O(n^2) or (2^n)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  More Examples...
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://leetcode.com/problems/find-all-anagrams-in-a-string/"&gt;Find all anagrams in a string&lt;/a&gt; --&amp;gt; &lt;a href="https://leetcode.com/problems/find-all-anagrams-in-a-string/discuss/1739067/C++-Solution-my-though-Thought-process"&gt;Solution&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://leetcode.com/problems/permutation-in-string/"&gt;Permutation in string&lt;/a&gt; --&amp;gt; &lt;a href="https://leetcode.com/problems/permutation-in-string/discuss/1762941/C++-Several-Solutions"&gt;Solution&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Note :&lt;/strong&gt; Solutions in above questions are just plain code.&lt;/p&gt;

&lt;p&gt;## References&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/8269916/what-is-sliding-window-algorithm-examples"&gt;Stackoverflow&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://medium.com/outco/how-to-solve-sliding-window-problems-28d67601a66"&gt;medium&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thank You 😊😊&lt;/p&gt;

</description>
      <category>programming</category>
      <category>codenewbie</category>
      <category>computerscience</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>Pascal's Triangle</title>
      <dc:creator>Arth </dc:creator>
      <pubDate>Mon, 09 May 2022 17:54:43 +0000</pubDate>
      <link>https://dev.to/user64bit/pascals-triangle-1kjn</link>
      <guid>https://dev.to/user64bit/pascals-triangle-1kjn</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In mathematics, Pascal's triangle is triangular array of binomial coefficient.&lt;br&gt;
below you can see how it looks like..&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    1
   1 1
  1 2 1
 1 3 3 1
1 4 6 4 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  How to Build it?
&lt;/h2&gt;

&lt;p&gt;First of all start with "1" and second rows as "1 1" then we can clearly see every element  in next rows(except 1) if sum of two elements from above row. (i.e, 1+1=2, 1+2=3, 1+3=4) and with this rules we can create pascal's triangle of n rows. &lt;br&gt;
 Below is visual of how it will look like,&lt;br&gt;
 &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IXcGduFt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://upload.wikimedia.org/wikipedia/commons/0/0d/PascalTriangleAnimated2.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IXcGduFt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://upload.wikimedia.org/wikipedia/commons/0/0d/PascalTriangleAnimated2.gif" alt="Pascal's Triangle" width="260" height="240"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Formula
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;[ ] let's take 0th row as first row and 0th column as first column,  so  we can get each value using    &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--KG2wUkmn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://wikimedia.org/api/rest_v1/media/math/render/svg/e8cc51538192fdf193790d4378c3a998a6b94262" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--KG2wUkmn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://wikimedia.org/api/rest_v1/media/math/render/svg/e8cc51538192fdf193790d4378c3a998a6b94262" alt="nCk" width="29" height="37"&gt;&lt;/a&gt; formula where n is row number and k is column number. so for finding 1st(0 indexed) element in 2nd row we can write 2C1 which will give 2.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;[ ] There is one another technique, in which  we need to solve (x + y)^n for nth row, if we solve (x +y)² then we will get 2nd row as coefficient of x and y in this solved formula which is x² + 2xy + y² . coefficients are (1 ,2 , 1) which is second row in pascal's triangle.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Implementation
&lt;/h2&gt;

&lt;p&gt;So it is time to code let's see how we can implement it which some different approaches.&lt;br&gt;
Approach 1 :  nCr formula&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include&amp;lt;iostream&amp;gt;
using namespace std;

// return Factorial of val
int fact(int val){
    int ans = 1;
    for(int i=1;i&amp;lt;=val;i++){
        ans = ans* i;
    }
    return ans;
}
// return next value in pascal triangle
int nextval(int row, int col){
    int result;
    result = fact(row) / (fact(col)* fact(row-col));
    return result;
}
int main(){
    int n = 5; // creating pascal's triangle of 5 rows
    for (int i=0;i&amp;lt;n;i++){
        for(int j=0;j&amp;lt;=i;j++){
            cout &amp;lt;&amp;lt; nextval(i,j) &amp;lt;&amp;lt; " ";
        }
        cout &amp;lt;&amp;lt; endl;
    }
    return 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Approach 2:  Another Formula&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include&amp;lt;iostream&amp;gt;
using namespace std;
int main(){
    int rows = 5;

    for (int i=1;i&amp;lt;=rows;i++){
        int nCr = 1;
        cout &amp;lt;&amp;lt; 1 &amp;lt;&amp;lt; " ";
        for(int j=1;j&amp;lt;i;j++){
            nCr = nCr *(i-j)/j;
            cout &amp;lt;&amp;lt; nCr &amp;lt;&amp;lt; " ";
        }
        cout &amp;lt;&amp;lt; endl;
    }
    return 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Approach 3: Using Vector for storing sum of two elements of previous row,&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include&amp;lt;iostream&amp;gt;
#include&amp;lt;vector&amp;gt;
using namespace std;
vector&amp;lt;vector&amp;lt;int&amp;gt;&amp;gt; pascal_triangle(int numRows) {
    vector&amp;lt;vector&amp;lt;int&amp;gt;&amp;gt; result(numRows);
    for(int i=0;i&amp;lt;numRows;i++){
        result[i].resize(i+1);
        result[i][0]=result[i][i]=1;

        for(int j=1;j&amp;lt;i;j++){
            result[i][j] = result[i-1][j] + result[i-1][j-1];
        }
    }
    return result;
}
void print(vector&amp;lt;vector&amp;lt;int&amp;gt;&amp;gt; result){
    for(int i=0;i&amp;lt;result.size();i++){
        for(int j=0;j&amp;lt;result[i].size();j++){
            cout &amp;lt;&amp;lt; result[i][j] &amp;lt;&amp;lt; " ";
        }
        cout &amp;lt;&amp;lt; endl;
    }
}
int main(){
    int n=10;
    vector&amp;lt;vector&amp;lt;int&amp;gt;&amp;gt; result = pascal_triangle(n);
    print(result);
    return 0;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Approach 4 : Python3 &lt;br&gt;
when we concatenate [1] and [0] like [1] + [0] and [0] + [1] then we get [1,0] and [0,1] , now sum of every element of list1 and list2 will be [1,1] which if second row of pascal triangle now this same process with [1,1] then we'll get [1,1,0] and [0,1,1] then [1,2,1] , after repeating this process we can get pascal's triangle of n rows.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def pascal_triangle(numRows):
    ans = [[1]]
    for _ in range(1,numRows):
        a = ans[-1] + [0]
        b = [0] + ans[-1]
        sum_ab = [x+y for (x,y) in zip(a,b)]
        ans.append(sum_ab)
    # print(ans)
    return ans

result = pascal_triangle(5)
for i in result:
    print(i)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;There are still other implementation of pascal's triangle , if you know any then let me know in comment box.&lt;/p&gt;

&lt;h2&gt;
  
  
  Some amazing facts
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] if you have noticed if we sum of element in row then we'll get 2^n , where n is row number in that pascal's triangle. ( 1 = 2° , 1+1 = 2 , 1+2+1 = 2² )
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5XflXu3x--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.mathsisfun.com/numbers/images/pascals-triangle-doubles.svg" alt="enter image description here" width="361" height="250"&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;[ ] if we take whole row as one number then it is power of 11, ( 11° = 1, 11 = 1  1,    11² = 1 2 1 )&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_DCGOtLb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.mathsisfun.com/numbers/images/pascals-triangle-11.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_DCGOtLb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.mathsisfun.com/numbers/images/pascals-triangle-11.svg" alt="enter image description here" width="365" height="210"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;[ ]  Also there are some other patterns in pascal's triangle which you can see in below image,&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eBKYPE1G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.mathsisfun.com/numbers/images/pascals-triangle-types.svg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eBKYPE1G--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://www.mathsisfun.com/numbers/images/pascals-triangle-types.svg" alt="enter image description here" width="364" height="312"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] &lt;a href="https://www.mathsisfun.com/pascals-triangle.html"&gt;https://www.mathsisfun.com/pascals-triangle.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;[ ] &lt;a href="https://en.wikipedia.org/wiki/Pascal%27s_triangle"&gt;https://en.wikipedia.org/wiki/Pascal%27s_triangle&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Thank You 😊😊&lt;/p&gt;

</description>
      <category>programming</category>
      <category>codenewbie</category>
      <category>algorithms</category>
      <category>cpp</category>
    </item>
    <item>
      <title>Digital Root</title>
      <dc:creator>Arth </dc:creator>
      <pubDate>Fri, 18 Mar 2022 16:54:09 +0000</pubDate>
      <link>https://dev.to/user64bit/digital-root-23ob</link>
      <guid>https://dev.to/user64bit/digital-root-23ob</guid>
      <description>&lt;p&gt;i found this while attempting CP Question and i got curious about it then i thought i should share this topic to everyone so here it is...&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What is Digital root? if you have done little competitive programming or practice for Data Structure or anything else you have got problem where you need to sum all digits of number and doing this process until number became single digit number. so that is Digital Root , let's talk about it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Example:&lt;br&gt;
123 = 1+2+3 =&amp;gt; 6&lt;br&gt;
456 = 4+5+6 =&amp;gt; 15 = 1+5 =&amp;gt; 6&lt;/p&gt;

&lt;p&gt;There are Few solution which can solve this Problem like Brute Force, but that will slow so we'll try mathematical technique to solve it which is digital root.&lt;/p&gt;

&lt;p&gt;Before solving this problem ,let me tell you some interesting properties of Number &lt;strong&gt;9&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;when you multiply any number(&amp;gt;0) with 9 then sum of all digits of that number will always 9 . Example :  345*9 = 3105 =&amp;gt; 3+1+0+5 =&amp;gt; 9 , you can check yourself this condition (try different numbers)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;When we add 9 to any number(here add means concatenating ) sum of all digits won't get effected, Example : 345 =&amp;gt; 3+4+5 =&amp;gt; 12 =&amp;gt; 1+2 =&amp;gt; 3, now add 9 , 3459 =&amp;gt; 21 =&amp;gt; 2+1=&amp;gt;3&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;when we divide any number by 9 , then what remainder we get is same as digital root of that number. Example : 15/9 =&amp;gt; 6 and 15=&amp;gt; 1+5=&amp;gt;6&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Any Perfect Square's digital root will be 1,4,7,9 (16=&amp;gt;1+6=&amp;gt;7, 36=&amp;gt;3+6=&amp;gt;9 etc)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;First i suggest to check out this &lt;a href="https://leetcode.com/problems/add-digits/"&gt;Leetcode Question&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;So for n==0 digital_root = 0&lt;br&gt;
otherwise digital_root = 1 + ((n-1)%9)&lt;br&gt;
Let's code this&lt;br&gt;
C++&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include &amp;lt;iostream&amp;gt;
using namespace std;
int digital_root(int n){
    if (n==0)return 0;
    else{
        return 1 + ((n-1)%9);
    }
}
int main() {
    int n;
    cout &amp;lt;&amp;lt; "Enter Number: ";
    cin &amp;gt;&amp;gt; n;
    cout &amp;lt;&amp;lt;endl;
    cout &amp;lt;&amp;lt; "Digital Root Value :"  &amp;lt;&amp;lt; digital_root(n);
    return 0;
} 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Python3&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def digital_root(n):
    if n==0:
        return 0
    else:
        return 1 + ((n-1)%9)

n = int(input("Enter Number: "))
print("Digital Root :",digital_root(n))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to Know more about it then check &lt;a href="https://en.wikipedia.org/wiki/Digital_root"&gt;Digital_Root&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Open for Suggestion&lt;br&gt;
Thank You &lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>python</category>
    </item>
  </channel>
</rss>
