<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rajendra Prajapat on Medium]]></title>
        <description><![CDATA[Stories by Rajendra Prajapat on Medium]]></description>
        <link>https://medium.com/@rajpra?source=rss-668410eb3dd7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ns81anqqXsbWG5-UzbSq0g.jpeg</url>
            <title>Stories by Rajendra Prajapat on Medium</title>
            <link>https://medium.com/@rajpra?source=rss-668410eb3dd7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 21:45:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rajpra/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[You Check Email 77 Times a Day. Only 1.4% of It Needs a Reply]]></title>
            <link>https://medium.com/@rajpra/you-check-email-77-times-a-day-only-1-4-of-it-needs-a-reply-c39d8f7922a4?source=rss-668410eb3dd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/c39d8f7922a4</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[email]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[remote-working]]></category>
            <category><![CDATA[startup]]></category>
            <dc:creator><![CDATA[Rajendra Prajapat]]></dc:creator>
            <pubDate>Sun, 01 Nov 2026 13:17:00 GMT</pubDate>
            <atom:updated>2026-11-01T13:17:00.466Z</atom:updated>
            <content:encoded><![CDATA[<h3>What 90 days of inbox data and five studies say about email overload, and a 15-minute setup to find the few emails that matter.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rd24g1KoU_K_FhTCQ0NDww.jpeg" /><figcaption>Image: AI-generated</figcaption></figure><p>If you run more than one inbox, you know the routine. Open Gmail, then the work account, then Outlook. Scroll past receipts, alerts, and newsletters. Close it all, and open it again twenty minutes later in case you missed something.</p><p>I wanted to know how much of that checking is actually needed. So we looked at our own data, and at the research.</p><blockquote><strong><em>Short answer:</em></strong><em> office workers check email about 77 times a day. Yet in 90 days of mail we sorted, machines sent 89% of it, and only 1.39% needed a reply. Checking more often doesn’t find those few messages faster. Separating machine mail from people mail does.</em></blockquote><h3>The numbers at a glance</h3><ul><li><strong>77</strong> email checks a day, on average (Mark et al., CHI 2016)</li><li><strong>117</strong> emails the average employee receives a day (Microsoft, 2025)</li><li><strong>89%</strong> of incoming mail was sent by machines (MorningZero, 90 days)</li><li><strong>1.39%</strong> of incoming mail needed a reply (MorningZero, 90 days)</li></ul><h3>The 77-check habit</h3><p>In a study by Gloria Mark and colleagues at UC Irvine and Microsoft Research, 40 office workers had their computer use logged for about 12 workdays. They checked email <strong>77 times a day</strong> on average (median 58) and spent 1 hour 23 minutes a day in it. Longer time in email predicted lower self-rated productivity, and heart-rate monitors showed higher stress.</p><p>Email has only spread since then:</p><ul><li>The average employee now receives <strong>117 emails a day</strong>, and <strong>40% check email before 6 a.m.</strong>, according to <a href="https://news.microsoft.com/de-ch/2025/06/17/new-microsoft-study-reveals-the-rise-of-the-infinite-workday-40-of-employees-check-email-before-6-a-m-evening-meetings-up-16/">Microsoft’s 2025 Work Trend Index report on the “infinite workday”</a>, based on Microsoft 365 signals and a survey of 31,000 workers.</li><li>The same report counts <strong>275 interruptions a day</strong> from meetings, chats, and email together, about one every two minutes.</li><li>In <a href="https://www.cnbc.com/2019/09/22/heres-how-many-hours-american-workers-spend-on-email-each-day.html">Adobe’s 2019 survey</a>, American workers estimated spending 209 minutes a day on work email alone.</li><li>Back in 2012, <a href="https://www.mckinsey.com/industries/hightech/our-insights/the-social-economy">McKinsey estimated</a> that managing email took 28% of the workweek for knowledge workers.</li></ul><p>Mark’s later research found that attention on any one screen now lasts about <strong>47 seconds</strong> on average, down from about 2.5 minutes in 2004.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LU-6W2c59_rwB1FdHlatGQ.jpeg" /><figcaption>Most checks find nothing that needs you. The habit stays anyway.</figcaption></figure><h3>What’s actually in your inbox</h3><p>MorningZero, the email client we build, sorts every incoming message into a category. Across all the mail it sorted in the 90 days to 20 September 2026, this is what arrived:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ixj1BWNkBsreWVI-qYuOuA.png" /><figcaption>Source: MorningZero classification data, 90 days to 20 September 2026</figcaption></figure><p>More than half were notifications: password resets, shipping updates, app alerts, “someone mentioned you.” Mail written by a person for you was about <strong>1 in 10</strong> messages.</p><h3>Only 1.4% needs a reply</h3><p>Being written by a person doesn’t mean a message needs you. Across the same 90 days, our classifier flagged <strong>1.39% of all incoming mail</strong> as needing a reply. A little more was worth reading, like a failed payment or an account notice. The rest needed nothing.</p><p>Put those numbers side by side. If your inbox looked like ours and you received Microsoft’s average of 117 emails a day, about one or two would need an answer. You would check 77 times to find them.</p><p>Your mix will differ. Our users are founders, consultants, and freelancers who run several mailboxes, and notification-heavy work accounts push the machine share up. The shape is what carries over: the work of email is finding a handful of messages in a stream that was mostly never written for you.</p><h3>Why checking more doesn’t help</h3><h4>Batching didn’t lower stress</h4><p>The popular fix is to check email in a few batches instead of all day. In Mark’s study, batching didn’t change measured stress. Heavy email users who batched rated themselves more productive, but they were just as stressed.</p><h4>Mail from people drives the overload</h4><p>A <a href="https://doi.org/10.3389/fpsyg.2024.1439070">2024 study in Frontiers in Psychology</a> by Kern, Ohly, Ďuranová, and Friedrichs followed 444 workers over two waves, plus 257 more in a second study. Only the number of <em>communication</em> emails people received predicted feeling overloaded. Task emails and the total number processed did not. That overload then predicted strain two weeks later.</p><p>That matches our data. The 10% of mail from people carries the weight, and it’s buried inside the 89% that isn’t.</p><h4>Email follows you into meetings</h4><p>Microsoft researchers found email multitasking in about 30% of remote meetings. The odds were 2.16 times higher in meetings with more than 10 people than in one-on-ones, and 1.86 times higher in morning meetings than after-hours ones (<a href="https://arxiv.org/abs/2101.11865">Cao et al., CHI 2021</a>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vY2dt7r0PpZn6epReuEjlQ.jpeg" /><figcaption>Large meetings are where email multitasking is most likely.</figcaption></figure><h3>How to find the 1.4%: a 15-minute setup</h3><ol><li><strong>Move machine mail out of the way.</strong> In Gmail, turn on inbox categories (Settings › See all settings › Inbox, then tick Promotions, Social, and Updates). A filter on the word “unsubscribe” that skips the inbox catches most newsletters. In Outlook, turn on Focused Inbox.</li><li><strong>Make one view for people mail.</strong> In Gmail, search category:primary is:unread and bookmark it. That&#39;s your first stop, not the full inbox.</li><li><strong>Decide what “needs you” means.</strong> A reply, a decision, or a money problem. Everything else can wait for a set time.</li><li><strong>Clear bulk senders weekly.</strong> Unsubscribe from what you never open. In Outlook on the web, Sweep can delete or move everything from one sender in a few clicks.</li><li><strong>Keep your phone out of big meetings.</strong> That’s where the research shows email multitasking peaks.</li></ol><p>This works well for one account. With three or four inboxes, you repeat every step in every account, and the “people” view is still split across tabs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ntQp23H96xilsEkxiY7zAw.jpeg" /><figcaption>The goal is a short list, not an empty inbox.</figcaption></figure><h3>If you run several inboxes</h3><p>That’s the problem we built <a href="https://morningzero.com/">MorningZero</a> for. It unifies Gmail, Outlook, iCloud, Yahoo, and IMAP inboxes, sorts every message into <strong>Needs you</strong> and <strong>Other</strong>, marks the ones waiting on your reply, and shows why each email landed where it did. The numbers in this article come from that sorting. There’s a 14-day free trial, no card needed.</p><h3>Method and limits</h3><ul><li>MorningZero data covers all mail classified across connected mailboxes in the 90 days to 20 September 2026. Categories and the reply flag come from its classifier, not manual review. Shares may not add up to exactly 100% because of rounding.</li><li>The “one or two a day” figure combines our reply rate with Microsoft’s average volume. They come from different groups of people, so treat it as an illustration.</li><li>The research studies are correlational and cover specific groups of workers. They show patterns, not laws.</li></ul><h3>Sources</h3><ol><li>Mark, G., Iqbal, S., Czerwinski, M., Johns, P., Sano, A., Lutchyn, Y. “Email Duration, Batching and Self-interruption: Patterns of Email Use on Productivity and Stress.” CHI 2016. <a href="https://www.microsoft.com/en-us/research/wp-content/uploads/2016/06/Email20Duration20Camera20Ready20submission3-1.pdf">PDF</a></li><li>Microsoft. “Breaking down the infinite workday.” Work Trend Index special report, June 2025. <a href="https://news.microsoft.com/de-ch/2025/06/17/new-microsoft-study-reveals-the-rise-of-the-infinite-workday-40-of-employees-check-email-before-6-a-m-evening-meetings-up-16/">Microsoft News</a></li><li>Adobe Email Usage Study 2019, via <a href="https://www.cnbc.com/2019/09/22/heres-how-many-hours-american-workers-spend-on-email-each-day.html">CNBC</a></li><li>McKinsey Global Institute. “The social economy.” July 2012. <a href="https://www.mckinsey.com/industries/hightech/our-insights/the-social-economy">mckinsey.com</a></li><li>Gloria Mark on attention span (47 seconds). <a href="https://www.universityofcalifornia.edu/news/how-sharpen-your-attention-and-meet-your-goals-2024">University of California</a></li><li>Kern, M., Ohly, S., Ďuranová, L., Friedrichs, J. “Drowning in emails.” Frontiers in Psychology 15, 2024. <a href="https://doi.org/10.3389/fpsyg.2024.1439070">doi:10.3389/fpsyg.2024.1439070</a></li><li>Cao, H. et al. “Large Scale Analysis of Multitasking Behavior During Remote Meetings.” CHI 2021. <a href="https://arxiv.org/abs/2101.11865">arXiv:2101.11865</a></li><li>MorningZero classification data, 90 days to 20 September 2026. <a href="https://morningzero.com/features/ai-triage">morningzero.com/features/ai-triage</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c39d8f7922a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ShareChat Interview Experience-2022(SDE-1)]]></title>
            <link>https://medium.com/@rajpra/sharechat-interview-experience-2022-sde-1-3da6a0a2c3c0?source=rss-668410eb3dd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/3da6a0a2c3c0</guid>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[interview-experience]]></category>
            <category><![CDATA[sharechat]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[coding-interviews]]></category>
            <dc:creator><![CDATA[Rajendra Prajapat]]></dc:creator>
            <pubDate>Thu, 24 Feb 2022 17:09:31 GMT</pubDate>
            <atom:updated>2022-02-24T17:09:31.055Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/704/1*aAYdaHvvuhzb9b8p6gVD5w.jpeg" /></figure><p>Hello Everyone</p><p>Last month was amazing for me. I received calls from more than thirty companies’ HR and interviewed for about ten product-based start-ups and companies, including Amazon, Sharechat, Make My Trip, and Newgera. I will write another post about how I received this response.</p><p>I received offers from Sharechat and Make My Trip on 20 January 2022. During that time, I was in the final round of Amazon, but I accepted the Sharechat offer instead.</p><p>I applied for the SDE-1 Backend role at Sharechat via email and LinkedIn in November 2021. On December 27, 2021, HR sent me an email with a HackerEarth Coding assessment link.</p><h3>Preliminary Round: Online Coding Assessment</h3><p>It was an online coding test with three DSA questions. I was able to solve all three in time. For three questions, the distribution of scores was 20–50–100, which means one was easy, one medium, and one difficult.</p><p>Two days later, I received an email from HR saying that I cleared coding round and shortlisted for Onsite-Interview process.</p><pre>Email was something like this: </pre><pre>You have been shortlisted for the interview process with us at ShareChat</pre><pre><strong>Round1:</strong>DSA round</pre><pre><strong>Round2:</strong>Final round with HM (Low level Design+Techno-managerial discussion)</pre><h3>Virtual Onsite 1 — Coding Round</h3><p>I scheduled this round(DSA) for January 4, 2022. This was conducted on Google Hangouts. It was a One-hour coding round.</p><p>2 LeetCode medium problem. One was related to tree traversal and another was related to two pointers with binary search.</p><p>Although I struggled with constraints in the second problem, I was able to solve it at the end. My interviewer was very helpful and gave hints.</p><p><strong>Result:</strong> HR called me on the same day to confirm date &amp; time for the HM interview round.</p><h3>Virtual Onsite 2— Hiring Manager Round</h3><p>I really enjoyed this interview. The interviewer was very helpful. It was supposed to be an LLD round but It was a mix of HLD(High-level design) concepts, DBMS concepts, and My projects.</p><p>These are the some of the questions I was asked, and I remember:)</p><ol><li>About my projects</li><li>CS Fundamentals for example Multi-threading, Concurrency, Mutex, Deadlock(how to implement), MongoDB, MySQL, ACID, CAP</li></ol><p>….</p><p>The interviewer was more interested in understanding the way I think than the concepts I know. I also received excellent feedback from the interviewer at the end of the interview regarding how I could improve my skills.</p><p><strong>Result: </strong>The next day, HR called to tell me that I had cleared the process.</p><h3>My learnings which can help you in your next interview</h3><ol><li>Practice mock interviews on <a href="https://www.pramp.com/dashboard#/">PRAMP</a>.</li><li>Complete this LeetCode card before interview: <a href="https://leetcode.com/explore/interview/card/coding-interview-strategy/">Coding interview Strategy</a></li><li>Always be confident and have a smile on your face even if you are not prepared for the interview.</li><li>Show your interest in the company and the required tech stack for the role.</li><li>Solve LeetCode or GFG problems</li></ol><p>I hope my interview experience help you for your future interviews.</p><p>All the best ❤</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3da6a0a2c3c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Solving 0–1 Knapsack Problem Using Dynamic Programming]]></title>
            <link>https://blog.devgenius.io/solving-0-1-knapsack-problem-using-dynamic-programming-acebe94521a7?source=rss-668410eb3dd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/acebe94521a7</guid>
            <category><![CDATA[cpp]]></category>
            <category><![CDATA[knapsack]]></category>
            <category><![CDATA[knapsack-problem]]></category>
            <category><![CDATA[pd]]></category>
            <category><![CDATA[dynamic-programming]]></category>
            <dc:creator><![CDATA[Rajendra Prajapat]]></dc:creator>
            <pubDate>Thu, 02 Jul 2020 12:22:22 GMT</pubDate>
            <atom:updated>2020-07-02T12:48:39.058Z</atom:updated>
            <content:encoded><![CDATA[<p>A person finds a magic cave that has various types of jewelry, diamonds with the price tags and weights, but the person has only one beg with W kg capacity, and he can not enter the cave once he goes outside. So, the person wants to select items that can give him maximum profit. This problem is called the Knapsack problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*HIhTMJ2qXPo0uUWwAeipMQ.jpeg" /></figure><p>In simple words, we have a list of items with their weights and profits and a beg(knapsack) with a limited capacity. And we want to select items with the total weight less than or equal to the beg’s capacity and want to maximize the profit. Here is an example.</p><pre>Items   1      2     3     4    5<br>weight  2kg    5kg   3kg   8kg  1kg<br>profit  3      5     5     9    3</pre><pre>Capacity of beg: 8kg  </pre><p>Mathematical form: Let the weight of the ith item is w_i kg and the price of the ith item is p_i. The capacity of knapsack is W kg.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pcn5UElqNKu3x3OPnVXgyA.jpeg" /></figure><p>So why this problem is hard. let us understand it by finding all possible ways for the given example</p><pre>Items            1   2   3   4   5<br>combination-1    0   0   0   0   1  (we take only item 5) profit: 3<br>combination-2    0   0   0   1   1  (this is not possible because total weight is 9 which greater than the capacity. </pre><pre>So in this way if we find all the conbinations and check which is maximum, it will take exponential time. Because there are total 2^n combinations. This is why, the problem is NP-Complete. There is no polinomial solution is available for the 0-1 knapsack.  </pre><p>In this blog, we will discuss the dynamic programming approach to solve the 0–1 knapsack problem that solves the problem in pseudo-polynomial time.</p><p>In this approach, we do not find the solution directly for weight W, but instead of it, we start from capacity 0 means what would be the maximum profit if knapsack size is 0 and then one and so on. Let’s understand it by an example:</p><pre>item    1    2   3    4<br>weight  5    3   4    2<br>profit  5    6   8    3<br>And the size of knapsack is 8.</pre><p>To store all the values we will create a table of size n*W where n is the number of items and W is the size of the knapsack. So let’s create the table:</p><pre>   1. When Capacity is 0 then the profit will be 0 in all cases.<br>   2. When Number of items is 0 then also profit will be 0, no matter what is capacity. </pre><pre>   items     0   1   2   3   4   5   6   7   8   &lt;- capacity    <br>     0       0   0   0   0   0   0   0   0   0 <br>     1       0<br>     2       0<br>     3       0<br>     4       0</pre><pre>   3. when item 1 is taken the minimum weight is 5 that means if capacity is 5 then we get profit 5, if capacity is less than 5 then profit would be 0.  <br>   4. If capacity is greater than 5 then the profit is still 5.</pre><pre>   items     0   1   2   3   4   5   6   7   8   &lt;- capacity    <br>     0       0   0   0   0   0   0   0   0   0 <br>     1       0   0   0   0   0   5   5   5   5<br>     2       0  <br>     3       0<br>     4       0</pre><pre>   5. When we are at item 2, we can choose both item 1 as well as item-2. And weight of item 2 is 3 kg means mimimum capacity 3 is required to get profit equals to six.<br>   6. If we take both items 1 &amp; 2 then the capacity required is 8 to get profit = 11.</pre><pre>   items     0   1   2   3   4   5   6   7   8   &lt;- capacity    <br>     0       0   0   0   0   0   0   0   0   0 <br>     1       0   0   0   0   0   5   5   5   5<br>     2       0   0   0   6   6   6   6   6   11 <br>     3       0<br>     4       0<br>  <br>  7. If we are at item 3, we can choose item 1 and item2 as well. If we take only item 3, then the profit would be 8. If we choose item 2 &amp; 3 then profit would be 14.</pre><pre>   items     0   1   2   3   4   5   6   7   8   &lt;- capacity    <br>     0       0   0   0   0   0   0   0   0   0 <br>     1       0   0   0   0   0   5   5   5   5<br>     2       0   0   0   6   6   6   6   6   11 <br>     3       0   0   0   6   8   8   8   14  14<br>     4       0  </pre><pre>   8.  When we are at item 4,we can choose also choose item 1,2 &amp; 3.</pre><pre>   items     0   1   2   3   4   5   6   7   8   &lt;- capacity    <br>     0       0   0   0   0   0   0   0   0   0 <br>     1       0   0   0   0   0   5   5   5   5<br>     2       0   0   0   6   6   6   6   6   11 <br>     3       0   0   0   6   8   8   8   14  14<br>     4       0   0   3   6   8   9   11  14  14   </pre><p>The last element in the table is our solution which is when all items are considered and capacity is equal to W.</p><p>We can calculate any element in the table by the given formula.</p><pre>V[i,w] = max {V[i-1, w], V[ i-1, w - w[i] ] + p[i]<br>where i is item and w is capacity. </pre><p>For example, when we are at item 3 and capacity is 7 then</p><pre>w[3] = 4 and p[i] = 8 </pre><pre>So V[3,7] = max{ V[3-1,7],V[3-1,7-4] + 8}<br>          = max{ V[2,7], V[2,3]+8 }</pre><pre>from the table V[2,7] = 6 and V[2,3] = 6  <br>   V[3,7] = max{6,6+8} = max{6,14} = 14<br>   V[3,7] = 14 (same as we calculated in table)</pre><p>Let’s write the pseudo-code for the given approach.</p><pre>for w = 0 to W:<br>   V[0, w] = 0</pre><pre>for i = 0 to n:<br>   V[i, 0] = 0</pre><pre>for i = 1 to n: <br>   for w = 1 to W: <br>      if w[i] ≤ w and p[i] + V[i-1, w-w[i] ] &gt; V [i -1,w] then:<br>            V[i, w] = p[i] + c[i-1, w-w[i] ] <br>      else <br>         c[i, w] = c[i-1, w]</pre><p>The time complexity of the algorithm is O(n*W).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=acebe94521a7" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/solving-0-1-knapsack-problem-using-dynamic-programming-acebe94521a7">Solving 0–1 Knapsack Problem Using Dynamic Programming</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Number Systems And Their Conversions Using C++]]></title>
            <link>https://blog.devgenius.io/number-systems-and-their-conversions-using-c-5b1ea99f200b?source=rss-668410eb3dd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b1ea99f200b</guid>
            <category><![CDATA[c-plus-plus-language]]></category>
            <category><![CDATA[internity]]></category>
            <category><![CDATA[number-system]]></category>
            <category><![CDATA[numbers]]></category>
            <category><![CDATA[binary]]></category>
            <dc:creator><![CDATA[Rajendra Prajapat]]></dc:creator>
            <pubDate>Thu, 04 Jun 2020 13:45:32 GMT</pubDate>
            <atom:updated>2020-06-04T13:45:32.122Z</atom:updated>
            <content:encoded><![CDATA[<h4>Number systems are the techniques to represent numbers in the computer system.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xhVZn4ChbM_oJNhCy9LdMg.png" /></figure><p>As a programmer, It is essential to have a basic knowledge of number systems. We have four major number systems:</p><ol><li>Decimals</li><li>Binary</li><li>Octal</li><li>Hexadecimal</li></ol><h4>1. Decimals</h4><p>The most commonly used number system in our day-to-day life is decimals. This number system has base-10, and all numbers are created with ten digits: 0,1,2,3, 4,5,6,7,8, 9. In the decimal number system, each position represents a specific power of 10. Here is an example:</p><pre>1562 = 1 * 10³ + 5 * 10² +6 *10¹ +2*10⁰<br>     = 1*1000 + 5*100 + 6*10 + 2 <br>      one thousand five hundred sixty two</pre><h4>2. Binary</h4><p>It is a base-2 number system that uses two digits 0 and 1. In computer science, a single digit is referred to as a bit, which is the smallest unit of memory in computers. Each position, in a binary number, represents a specific power of two. Let’s see an example:</p><pre>1010 = 1*2³ + 0*2² + 1*2¹ + 0*2⁰<br>     = 1*8 + 0*4 + 1*2 + 0*1<br>     = 8 + 0 + 2 + 0<br>     = 10<br>// That means 1010 in binary is equvilent to 10 in decimal number system.</pre><p><strong>3. Octal</strong></p><p>It is a base-8 number system that uses eight digits 0,1,2,3,4,5,6,7. It is also known as Oct. Position of each digit, in an octal number, has a weight, which equals to a specific power of 8. Here is an example:</p><pre>25624 = 5*8⁴ + 5*8³ + 6*8² +2*8¹ + 4*8⁰<br>      = 5*4096 + 5*512 + 6*64 + 2*8 + 4*1<br>      = 23444<br>// That means 25624 in octal number system is equivalent to 23444 in decimal number system</pre><h4>4. Hexa-Decimal</h4><p>Hexadecimal number system, also known as hex, is a base-16 number system that uses 10 digits and 6 letters: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F.</p><pre>HexaDecimal      decimal <br>A                10<br>B                11<br>C                12<br>D                13<br>E                14<br>F                15</pre><p>In computer systems, storing 32-bit or 64-bit data is a difficult task. So these 32-bit or 64-bit data is arranged in 4-bit groups and converted to the hexadecimal number system. The position of each digit or letter in hex represents a specific power of 16.</p><pre>Example: <br>8A1F = 8*16³ + 10*16² + 1*16¹ + 15*16⁰<br>     = 8*4096 + 10*256 + 1*16 + 15*1<br>     = 35359<br>//It implies that 8A1F in hex is equivalent to 35359 in decimal</pre><h3>Conversions</h3><h4>Any base to decimal number system</h4><p>As we have seen, in all the examples above, that position of each digit or letter represents the specific power of the new base. we will make use of it to convert any base to the decimal number system.</p><pre>int toDecimal(string number,int base)<br>{<br>    int decimal= 0;<br>    int size = number.length();<br>    for(int i=0; i&lt;size; i++) //check for each position<br>    {<br>        //calculate digit * base^position for each position<br>        <br>        if(number[i]&gt;=&#39;A&#39;) // if it has more than 10 digits<br>        {<br>            ans += (number[i]-&#39;A&#39;+10) *pow(base,size-i-1);<br>        } <br>        else<br>        {<br>            ans += (number[i]-&#39;0&#39;) *pow(base,size-i-1);<br>        }<br>    }<br>    return ans;<br>}</pre><h4>Decimal to Any Number System</h4><p>To convert a decimal to another base, we can follow these steps:</p><ol><li>Divide the decimal number with a new base and replace the current decimal to the quotient.</li><li>Store the remainder to a list.</li><li>Go to step 1 if the decimal number is not equal to 0.</li><li>Save all the remainders to a string in reverse order.</li></ol><p>let’s convert 12(base-10) to binary(base-2)</p><pre>division         quotient             remainder<br>12/2              6                   0<br>6/2               3                   0<br>3/2               1                   1<br>1/2               0                   1</pre><pre>list of remainders : 0 0 1 1<br>reverse of list    : 1 1 0 0</pre><pre>list to string : 1100(base-2)</pre><p>In our program, instead of storing the remainder in a list and then reverse it, we will use a stack here to save remainders. In our program “singleDigitPreprocess” function will covert a remainder to a digit or letter based on the new base.</p><pre>char singleDigitPreprocees(int n)<br>{<br>    if(n&lt;10) return n+&#39;0&#39;;<br>    else if(n &gt;= 10){<br>        return &#39;A&#39;+(n-10);<br>    } <br>}</pre><pre>string decimalTo(int decimal,int base = 16)<br>{<br>    stack&lt;char&gt; remainders;<br>    if(decimal == 0) return &quot;0&quot;;<br>    while(decimal &gt; 0)<br>    {<br>        char rem = singleDigitPreprocees(decimal%base);<br>        decimal = decimal/base;<br>        remainders.push(rem);<br>    }</pre><pre>    string any_base = &quot;&quot;; <br>    while(!remainders.empty())<br>    {<br>        any_base += remainders.top();<br>        remainders.pop();<br>    }<br>    return any_base;<br>}</pre><p>If we know how to convert a number base-10 number to any base and any base number to base-10 number, we can convert any base number to any other base number.</p><p>Let’s say we want to convert a base-2 number to base-8 number. One way to do so is first, we will convert the base-2 to decimal then decimal to base-8 number. But other ways also there, to convert one number system to another. For example, to convert a number from binary to octal, we can use a simple trick. The trick is to the first group the bits of size three from the right-most position, and then convert these groups to decimal, because numbers from 0 to 7 are the same in both(decimal and octal) number systems. If a group of 3 doesn’t complete, we can add extra 0s to the left-most position.</p><pre>Lets convert 10101(base-2) to octal<br>10101 =&gt; 010 101</pre><pre>010(base-2) = 2(base-10) = 2(base-8)<br>101(base-2) = 5(base-10) = 5(base-8)</pre><pre>10101(base-2) =&gt; 010 101 =&gt; 2 5 =&gt; 25(base-8)</pre><p>The C++ code for all the conversions can be found <a href="https://github.com/InternityFoundation/DS-ALGO_Rajendra_Prajapat/tree/master/Number%20System%20Conversion%20Project">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b1ea99f200b" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/number-systems-and-their-conversions-using-c-5b1ea99f200b">Number Systems And Their Conversions Using C++</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Competitive Programming with C++ : Part 2]]></title>
            <link>https://blog.devgenius.io/competitive-programming-with-c-part-2-4e23cff31f5f?source=rss-668410eb3dd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e23cff31f5f</guid>
            <category><![CDATA[cpp]]></category>
            <category><![CDATA[competitive-programming]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[c-plus-plus-language]]></category>
            <dc:creator><![CDATA[Rajendra Prajapat]]></dc:creator>
            <pubDate>Tue, 02 Jun 2020 21:43:19 GMT</pubDate>
            <atom:updated>2020-06-02T21:43:19.462Z</atom:updated>
            <content:encoded><![CDATA[<h3>Competitive Programming with C++ : Part 2</h3><p>This is part 2 of my blog ‘Competitive Programming with C++’. C++ is an advanced variant of C, where you can use all functionalities of C language as well as some advanced features like classes, namespaces. If you are already familiar with C programming, learning C++ will not be difficult for you. In this blog, we will learn C++ basics to get started with competitive programming.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*ksrg39Fk4QrzhVnfhNF-pg.png" /></figure><h3>Basic Structure of C++ Program</h3><pre>#include&lt;iostream&gt; /*include libraries*/<br>using namespace std;</pre><pre>int main()<br>{<br>    cout&lt;&lt;”Hello World”;<br>    return 0;<br>}</pre><p>The basic structure of a C++ program mainly contains -<br>1. Libraries Section<br>2. Main Function Section</p><ol><li><strong>Libraries Section</strong></li></ol><pre>#include&lt;iostream&gt;</pre><p>In easy words, <strong><em>#include</em></strong> is a preprocessor directive that copies the content of the given file or library to the current program before compilation. <strong><em>iostream</em></strong> is a file or a library which defines the functions related to the Input/Output streams. So by <strong>#include&lt;iostream&gt;,</strong> all the functions defined in <em>iostream</em> would be imported to our program.</p><pre>using namespace std;</pre><p>This line adds a prefix std:: to all the functions used in our program, defined in the <em>standard libraries like iostream</em>. For example, when we call a function ‘cout’, defined in iostream, just before the compilation, it becomes std::cout. To get a clear picture of the namespace, you can refer to this <a href="https://www.geeksforgeeks.org/namespace-in-c/">link</a>.</p><p><strong>2. Main Function Section</strong></p><pre>int main(){<br> //body of function <br>}</pre><p>The starting point of a C++ program is the main function. The body of every function in the C++ program starts with ‘{’ and ends with ‘}.’ ‘{’ signifies the start of the block of code, and ‘}’ means the end of the block of code. In the body of the function, we write a group of statements to perform a given task.</p><h4><strong>Comments</strong></h4><p>‘//’ and ‘/* */’ symbols are used for commenting on the code. The compiler ignores the code after // and code between /* and */, and it doesn’t affect the output of the program. Comments are used to make the code easy to understand for others.</p><h3>DataTypes in C++</h3><p>A variable is a symbol or label connected to the address of some information in computer memory. In C++, before declaring a variable, we need to specify what we want our variable to store(numeric values or characters values). For example, let’s say we tell our program that the variable ‘var’ stores numeric values. Once we do that, we can not store any other type of data such as string or character values in that variable.</p><p>C++ has many datatypes for numeric, boolean, and alphanumeric values. Some of the data types are <strong><em>i</em>nt, float, long long, char, bool, string,</strong> etc. When we see other programming languages like python, we don’t need to specify the datatype and can store any type of data in a variable. So why C++ have many datatypes? The answer to this question is the memory used, to store a value. As we know, different data types require a different amount of memory. So by using appropriate datatypes, we can save memory, which can be used for other data in our program. For example, when we want to store a boolean value that can be stored using 1 bit, then using an int variable that takes 4 bytes of memory, is useless. In technical interviews, one of the judging criteria of the program is the memory used by our program. So a programmer needs to understand various data types and their uses.</p><h4>The declaration, initialization of variables</h4><p>The basic syntax for declaration of a variable is:</p><pre>datatype variable_name;</pre><p>The syntax for initialization of a variable is</p><pre>variable_name = value;</pre><p>We can declare and initialize a variable simultaneously</p><pre>datatype variable_name = value;</pre><p>let us see some of the datatypes with there ranges:</p><p><strong>int</strong> is used for storing numerical values. It takes 4 bytes of system memory to store the variable. Its range is -2147483648 to 2147483647. If we use an unsigned keyword before int, it will store values in the range of 0 to 4294967295.</p><pre>int var;          //range: -2147483648 to 2147483647 size: 4 bytes<br>unsigned int var; //range: 0 to 4294967295 size: 4 bytes<br>signed int  var;  //range: -2147483648 to 2147483647 size: 4 bytes</pre><p><strong>long long </strong>is also used for storing numerical values. signed long long can store values from ​-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. unsigned long long can store from 0 to 18,446,744,073,709,551,615. It takes 8 bytes of system memory.</p><pre>long long var;  //range: ​-9223372036854775808 to 9223372036854775807</pre><p><strong>Short int</strong> can store numerical values in the range of -32768 to 32767, and it only takes 2 bytes of system memory.</p><pre>short int var;  //range: -32768 to 32767</pre><p>Here is the list of all the datatypes with their range and size.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/322ba3cd9debd2ba8a4186ba61d66cdc/href">https://medium.com/media/322ba3cd9debd2ba8a4186ba61d66cdc/href</a></iframe><h3>Input and Output</h3><p>In C++, to take input, we just need to read the character by character, until a delimiter is reached, whether the input is from a file or by a user in the console. The delimiter is a symbol or character that marks the end of the input, and it may be a space or a new line character(\n). The library used for input and output streams in C++ is ‘<em>iostream’. The iostream </em>stands for the input-output stream. In C++, the input is stored as streams, and the stream is nothing but an interface where data is read/written sequentially.</p><h4>cout</h4><pre>#include&lt;iostream&gt;<br>using namespace std;<br>int main()<br>{<br>   cout&lt;&lt;&quot;Hello World!&quot;&lt;&lt;endl;<br>   cout&lt;&lt;&quot;C++ is a greate language \n&quot;;</pre><pre>}</pre><p>‘cout’ stands for the <strong>character output. ‘</strong>cout’ is used to display the output to the console. The text or values after ‘&lt;&lt;’ would be shown to console. In C++, to end a line ‘endl’ keyword or ‘\n’ (newline character) is used.</p><h4>cin</h4><pre>#include&lt;iostream&gt;<br>using namespace std;<br>int main()<br>{<br>    int var; //declare a variable <br>    cin&gt;&gt;var; //input a value for var<br>    cout&lt;&lt;var; // display the value of var in console</pre><pre>}</pre><p>‘cin’ stands for <strong>character input</strong>. ‘cin’ is used to take input from the standard input devices(it may be console or a file). Some times we get confused between ‘&lt;&lt;’ and ‘&gt;&gt;.’ We can remember it in this way: ‘&lt;&lt;’ is used for “sending values to console from the program” and ‘&gt;&gt;’ is used for “getting values to program from the console.” here is another example of input/output-</p><pre>#include&lt;iostream&gt;<br>using namespace std;<br>int main()<br>{<br>    string name; //declare a variable to store name<br>    cin&gt;&gt;name; //input name<br>    cout&lt;&lt;&quot;Hello &quot;&lt;&lt; name &lt;&lt;&quot;!&quot;&lt;&lt;endl;<br>}</pre><h4>getline</h4><p>The default delimiter in cin is a space; that means after space, all input would be ignored. The getline function allows us to define any character delimiter, and the default delimiter is a new line character. Here is an example-</p><pre>#include&lt;iostream&gt;<br>using namespace std;<br>int main()<br>{<br>    string name; //declare a variable to store name<br>    cin&gt;&gt;name; //input name<br>    cout&lt;&lt;&quot;Using cin &quot;&lt;&lt; name &lt;&lt;endl;</pre><pre>    string name2;<br>    getline(cin,name2);<br>    cout&lt;&lt;&quot;using getline&quot;&lt;&lt;name2&lt;&lt;endl;</pre><pre>}</pre><p>Try the above program, and enter your full name with space in input, and observe the output.</p><h3>Control flow</h3><h4>Decision-making blocks</h4><p>Some times in our program, we need to make decisions about a block of code to run or not. In that case, we can make use of if-else statements to specify which block to run or which not to run based on the given condition. Here is the syntax for if-else statements-</p><pre>if(condition1)<br>{<br>  //code which we want to run when condition 1 is true</pre><pre>}<br>else if(condition2)<br>{<br>  //code which we want to run when condition 2 is true</pre><pre>}<br>else if(condition3)<br>{<br>  //code which we want to run when condition 3 is true</pre><pre>}<br>else<br>{<br>  //default code to run when no conditions are setisfied<br>}</pre><p>How to specify the conditions for the if-else statement? Let&#39;s see some examples-</p><p>example 1: age is equal to 18 or not</p><pre>if(age == 18)<br>{<br>    cout&lt;&lt;&quot;Yes&quot;;<br>}<br>else <br>{<br>   cout&lt;&lt;&quot;No&quot;;<br>}</pre><p>example 2: age is between 18 to 23 or not</p><pre>if(age &gt; 18 and age&lt;23) //we can also use &#39;&amp;&amp;&#39; inplace of &#39;and&#39;<br>{<br>    cout&lt;&lt;&quot;Yes&quot;;<br>}<br>else <br>{<br>   cout&lt;&lt;&quot;No&quot;;<br>}</pre><p>example 3: age is less than 12 or greater than 50</p><pre>if(age &lt; 12 or age &gt; 50) //we can also use &#39;||&#39; inplace of &#39;or&#39;<br>{<br>    cout&lt;&lt;&quot;Yes&quot;;<br>}<br>else <br>{<br>   cout&lt;&lt;&quot;No&quot;;<br>}</pre><p>For a better understanding of C++ decision-making blocks, you can refer to the following <a href="https://www.w3adda.com/cplusplus-tutorial/cpp-decision-making-statements#:~:text=Decision%20making%20statement%20evaluates%20single,%E2%80%9D%20or%20%E2%80%9CFALSE%E2%80%9D%20otherwise.">link</a> and try to run the following program.</p><pre>#include&lt;iostream&gt;<br>using namespace std;<br>int main()<br>{<br>      string zone;<br>      cin&gt;&gt;zone; //input the zone <br> <br>      if(zone == &#39;red&#39;)<br>      {<br>          cout&lt;&lt;&quot;you can not go outside&quot;&lt;&lt;endl;<br>      }<br>      else if(zone == &#39;yellow&#39;)<br>      {<br>          cout&lt;&lt;&quot;If necessory then only go outside&quot;&lt;&lt;endl;<br>      }<br>      else if(zone == &#39;green&#39;)<br>      {<br>          cout&lt;&lt;&quot;You can go outside,but follow social distancing&quot;;<br>      }<br>      else <br>      {<br>           cout&lt;&lt;&quot;please provide correct input: one of (red,yellow,green)&quot;;<br>      }<br>      return 0;</pre><pre>}</pre><h4>Loops</h4><p>When we want to run a block of code, again and again, we can use loops in C++. Here we would be discussing ‘for’ loop and ‘while’ loop, widely used by programmers.</p><pre>for(initialization;condition;increment)<br>{<br>    //statements<br>}</pre><p>The flows-chart of for loop:</p><figure><img alt="The flow chart of for loop" src="https://cdn-images-1.medium.com/max/489/1*SjHe8VPaqeJLPKuwuZrBXw.jpeg" /><figcaption>‘for’ loop flow-chart</figcaption></figure><p>Example:</p><pre>#include&lt;iostream&gt;<br>using namespace std;<br>int main()<br>{<br>    for(int i=0;i&lt;5;i++)<br>    {<br>       cout&lt;&lt;i&lt;&lt;endl;<br>    }<br>    return 0;<br>}<br>/* output <br>0<br>1<br>2<br>3<br>4 */</pre><p>now let’s see, how a while loop works-</p><pre>//syntax of while loop<br>while(condition)<br>{<br>    //statements<br>}</pre><p>In a while loop, the code block will run again and again until the condition is not false. Here is an example for ‘while’ loop-</p><pre>#include&lt;iostream&gt;<br>using namespace std;<br>int main()<br>{<br>    int i=0;<br>    while(i&lt;5)<br>    {<br>       cout&lt;&lt;i&lt;&lt;endl;<br>       i = i+1;</pre><pre>    }<br>    return 0;<br>}</pre><pre>/* output <br>0<br>1<br>2<br>3<br>4 */</pre><h3>Arrays</h3><p>Now let’s say we want to store marks of the top 100 students in an exam. Based on our current knowledge, one way to do it is to create 100 variables and take input one by one. But another way to do it is to use an array. An array is a collection of the same type of data in contiguous memory.</p><h4>Declare Array</h4><pre>datatype array_name[size];</pre><h4>Set the value of the ith element to x</h4><pre>array_name[i]=x;</pre><p>Here is the full example of, what we learn in this entire blog</p><pre>#include&lt;iostream&gt;<br>using namespace std;<br>int main()<br>{<br>    int n;<br>    cin&gt;&gt;n; //input the number of students<br>    int marks[n]; // declare a int array of size n<br>   <br>    for(int i=0;i&lt;n;i++) //input marks of all students<br>    {<br>       cin&gt;&gt;marks[i];<br>    }<br>     </pre><pre>    //print scores<br>    int j=0;<br>    while(j&lt;n)<br>    {<br>       cout&lt;&lt;&quot;Marks of student i = &quot;&lt;&lt;i&lt;&lt;&quot; is &quot;&lt;&lt;marks[i]&lt;&lt;endl;<br>       j = j+1; <br>    }</pre><pre>    return 0;<br>}</pre><p>I hope it helps you. In the next part of this blog, we would solve a problem on the CodeChef platform by using the knowledge we gain in this blog.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e23cff31f5f" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/competitive-programming-with-c-part-2-4e23cff31f5f">Competitive Programming with C++ : Part 2</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Competitive Programming with C++ :  Part 1]]></title>
            <link>https://blog.devgenius.io/competitive-programming-with-c-part-1-3eb11c09fca7?source=rss-668410eb3dd7------2</link>
            <guid isPermaLink="false">https://medium.com/p/3eb11c09fca7</guid>
            <category><![CDATA[competitive-programming]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[c-plus-plus-language]]></category>
            <category><![CDATA[cpp]]></category>
            <dc:creator><![CDATA[Rajendra Prajapat]]></dc:creator>
            <pubDate>Sat, 30 May 2020 03:37:50 GMT</pubDate>
            <atom:updated>2020-06-02T16:10:53.287Z</atom:updated>
            <content:encoded><![CDATA[<h3>Competitive Programming with C++ : Part 1</h3><p>If you are here, that means you want to start Competitive programming, or you heard this word from somewhere. There are two ways to learn to program: one is to do some projects, and another is to start competitive programming. In projects, we learn by implementing solutions to real-world problems, whereas, in competitive programming, we learn by implementing various scenarios, given in a problem statement. In competitive programming, you write efficient and optimized code for the given problems on a platform in a given time in a programming language of your choice. In this blog, we would be discussing competitive programming.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/531/1*O4jlWnJD_zeYoI6-ZP0NSQ.png" /></figure><p>Competitive Programming has two parts: designing the algorithms and implementing the algorithm. So before dive into Competitive programming, let’s discuss what are the algorithms first.</p><h3>What are the algorithms?</h3><p>In simple words, the algorithm is a sequence of well-defined tasks to complete a significant task. For example, we have some items with a price tag. Now we want to find the item at the least price. For this, we can write the algorithm as follows-<br>First, we pick-up an item and put it in our beg, and then check the price of the next item, and if the item has a lower price than the product we have in our beg, we replace it with the new item, otherwise, check for the price of the next item.</p><p>Pseudo-code for this algorithm can be written as follows:</p><pre>1. Pick up the first item<br>2. Choose a next item <br>3. If the price of the item is lower than the price of the item in our beg, then replace it with a new item. <br>4. Go to 2 until all the items are not checked. </pre><h3>Designing of the Algorithms</h3><p>In competitive programming, writing an algorithm is not enough, But it requires writing an efficient algorithm that solves a well-defined computational problem. An algorithm to solve a given problem may be the combination of multiple well-known algorithms or methods. The design of the algorithm requires good problem-solving skills as well as mathematical skills.</p><h3>Implementing the Algorithms</h3><p>Once we come up with an algorithm that solves the problem, the next step is to correctly implement it, which requires good programming skills. Our solution to a problem is evaluated by running our program on a large number of test cases. In competitive programming, the code should be short so we can implement it in a short period because, in Competitive Programming, implementation time is more important to get a good score.</p><h3>Which Programming Language is used in Competitive Programming?</h3><p>You can use any programming language to test your Competitive Programming skills. The languages supported by most of the platforms are C, C++, Python, Java, and Kotlin. C++ is the most popular programming language for competitive programming because of its speed, and extensive library support such as STLs and Algorithms. I also prefer C++ for competitive programming.</p><h3>Which Platform is best for Competitive programming?</h3><p>There are various platforms are available for the Competitive Programming. The most popular platforms in India are <a href="http://codechef.com/">Codechef</a>, <a href="https://codeforces.com/">Codeforces</a>, A<a href="https://atcoder.jp/">tcoder</a>, <a href="https://www.hackerrank.com/">HackerRank</a>, <a href="https://www.hackerearth.com/">HackerEarth</a>, <a href="https://leetcode.com/">LeetCode</a>. If you are new to programming, you should attend beginner contests on AtCoder, division-3 contests on Codeforces, and long-contest on Codechef. The long-contest on CodeChef is a great way to learn algorithms. In this contest, you are provided 6–7 problems for 10 days where you are allowed to use the internet or books.</p><h3>Why you should do Competitive Programming?</h3><p>If you love challenges and programming, then Competitive Programming is for you. If this motivation is not enough for you to start Competitive Programming, let me give you the other, If you are good at Competitive Programming, you can easily clear the technical rounds of the hiring process.</p><p>Competitive Programming teaches us to solve a problem by multiple approaches in a short time. It improves our problem-solving skills, debugging skills, and mathematical skills. When you start competitive programming, you will enjoy this game.</p><p>In part 2 of this blog, we will start with the basics of C++ programming for Competitive Programming.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3eb11c09fca7" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/competitive-programming-with-c-part-1-3eb11c09fca7">Competitive Programming with C++ :  Part 1</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>