<?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: Somnath Das</title>
    <description>The latest articles on DEV Community by Somnath Das (@buildwithsomnath).</description>
    <link>https://dev.to/buildwithsomnath</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2217447%2Fd77fe31f-d668-4649-95f9-0fffd8bb2728.jpg</url>
      <title>DEV Community: Somnath Das</title>
      <link>https://dev.to/buildwithsomnath</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/buildwithsomnath"/>
    <language>en</language>
    <item>
      <title>Real-Life Algorithms: The Checkout Queue Problem 🛒💻</title>
      <dc:creator>Somnath Das</dc:creator>
      <pubDate>Fri, 10 Jul 2026 12:08:53 +0000</pubDate>
      <link>https://dev.to/buildwithsomnath/real-life-algorithms-the-checkout-queue-problem-f14</link>
      <guid>https://dev.to/buildwithsomnath/real-life-algorithms-the-checkout-queue-problem-f14</guid>
      <description>&lt;p&gt;Sometimes the best algorithmic challenges aren't found on LeetCode or HackerRank—they're hiding in plain sight during your weekend errands.&lt;/p&gt;

&lt;p&gt;While waiting outside a packed mall during a massive promotional event, I watched the security team manage the crowd by pulsing people inside group by group. Naturally, my developer brain couldn't just stand there; it immediately turned this crowd-control tactic into a queuing theory puzzle.&lt;/p&gt;

&lt;p&gt;If you love a good math or system optimization problem, here is the scenario I came up with:&lt;/p&gt;

&lt;h2&gt;
  
  
  The Setup
&lt;/h2&gt;

&lt;p&gt;Imagine a massive line of &lt;code&gt;n&lt;/code&gt; shoppers waiting outside. The store allows exactly &lt;code&gt;k&lt;/code&gt; people inside at a time, and there are &lt;code&gt;m&lt;/code&gt; open parallel cash registers.&lt;/p&gt;

&lt;p&gt;The Constraints&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;n&lt;/code&gt; (total shoppers) can reach up to 1,000,000,000.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;k&lt;/code&gt; (batch capacity) maxes out at 5,000.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;m&lt;/code&gt; (registers) maxes out at 100.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Mechanics
&lt;/h2&gt;

&lt;p&gt;Here is how the system operates to keep things from descending into chaos:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The Batch System: Shoppers enter in strict groups of &lt;code&gt;k&lt;/code&gt;. (The very last group will just be the remainder of &lt;code&gt;n&lt;/code&gt; modulo &lt;code&gt;k&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Coin Flip: Every customer who walks in has exactly a 50% chance of actually making a purchase.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Perfect Efficiency: The buyers are incredibly smart—they instantly divide themselves evenly across the &lt;code&gt;m&lt;/code&gt; registers to keep the lines as short as possible.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Bottleneck: Every transaction takes exactly 1 second. Therefore, the total time for a whole group to finish is determined by the length of the longest register line.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The Gate: The next group of &lt;code&gt;k&lt;/code&gt; shoppers cannot step foot inside until every single buyer from the current group has finished checking out. (Non-buyers just wait at the exit, taking 0 extra seconds).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Challenge
&lt;/h2&gt;

&lt;p&gt;Given &lt;code&gt;n&lt;/code&gt;, &lt;code&gt;k&lt;/code&gt;, and &lt;code&gt;m&lt;/code&gt;, what is the expected total time (in seconds) it will take to process the entire crowd?&lt;/p&gt;

&lt;p&gt;Example to visualize:&lt;br&gt;
If a group enters and exactly 5 people decide to buy, and we have 2 registers (&lt;code&gt;m = 2&lt;/code&gt;)...&lt;br&gt;
The optimal split is 3 people in one line and 2 in the other. The longest line has 3 people, so that entire batch takes exactly 3 seconds to clear! (But remember, the actual number of buyers in each batch is a probability distribution).&lt;/p&gt;

&lt;p&gt;This problem perfectly blends probability, queuing theory, and algorithmic optimization. It is a fantastic exercise in calculating expected values, working with combinations, and handling edge cases with that tricky final batch.&lt;/p&gt;

&lt;p&gt;Happy coding, and may your algorithms be as perfectly distributed as these hypothetical shoppers!&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>computerscience</category>
      <category>programming</category>
    </item>
    <item>
      <title>My First App Got Rejected. Here's What It Taught Me.</title>
      <dc:creator>Somnath Das</dc:creator>
      <pubDate>Tue, 07 Jul 2026 11:59:57 +0000</pubDate>
      <link>https://dev.to/buildwithsomnath/my-first-app-got-rejected-heres-what-it-taught-me-8ek</link>
      <guid>https://dev.to/buildwithsomnath/my-first-app-got-rejected-heres-what-it-taught-me-8ek</guid>
      <description>&lt;p&gt;A few weeks ago, I submitted my Android app Resist &amp;amp; Rise for publication.&lt;/p&gt;

&lt;p&gt;I was excited.&lt;/p&gt;

&lt;p&gt;A few days later, I received this email:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Your app doesn't meet the minimum quality standards to be published.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;At first, I was disappointed. But after reviewing my app, I realized something important:&lt;/p&gt;

&lt;p&gt;Building a working app isn't the same as building a polished product.&lt;/p&gt;

&lt;p&gt;The rejection made me rethink everything—from onboarding and first impressions to branding, UX, and overall user experience.&lt;/p&gt;

&lt;p&gt;Now I'm improving:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Better onboarding&lt;/li&gt;
&lt;li&gt;Stronger UI polish&lt;/li&gt;
&lt;li&gt;Privacy policy&lt;/li&gt;
&lt;li&gt;More meaningful recovery insights&lt;/li&gt;
&lt;li&gt;A smoother first-time user experience&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This rejection wasn't the end—it was feedback.&lt;/p&gt;

&lt;p&gt;Every rejected build is an opportunity to create something better.&lt;/p&gt;

&lt;p&gt;Back to building. Back to improving. 🚀&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>mobile</category>
      <category>uiux</category>
      <category>startup</category>
    </item>
    <item>
      <title>Yes, I just built a fully functional Android APK using React Native.</title>
      <dc:creator>Somnath Das</dc:creator>
      <pubDate>Mon, 06 Jul 2026 06:36:30 +0000</pubDate>
      <link>https://dev.to/buildwithsomnath/yes-i-just-built-a-fully-functional-android-apk-using-react-native-2152</link>
      <guid>https://dev.to/buildwithsomnath/yes-i-just-built-a-fully-functional-android-apk-using-react-native-2152</guid>
      <description>&lt;p&gt;And the craziest part? AI handled the entire design.&lt;/p&gt;

&lt;p&gt;I wanted an app that relies entirely on local-device storage. Instead of wrestling with UI mockups and boilerplate code, I let Antigravity AI act as my technical co-founder.&lt;/p&gt;

&lt;p&gt;It didn't just autocomplete lines of code. It:&lt;/p&gt;

&lt;p&gt;Orchestrated the React Native setup&lt;/p&gt;

&lt;p&gt;Structured the local storage seamlessly&lt;/p&gt;

&lt;p&gt;Designed the complete user interface from scratch&lt;/p&gt;

&lt;p&gt;We are moving past AI that just writes snippets. With agentic execution, the barrier to entry for native mobile development just hit zero. The developers who learn to direct these AI agents won't just code faster—they will ship entire products single-handedly.&lt;/p&gt;

&lt;p&gt;What do you think of this shift?&lt;br&gt;
Let me know in the comments.&lt;/p&gt;

&lt;h1&gt;
  
  
  ReactNative #AntigravityAI #AndroidDev #AgenticAI #TechTrends
&lt;/h1&gt;

</description>
      <category>android</category>
      <category>reactnative</category>
      <category>antigravity</category>
      <category>agentaichallenge</category>
    </item>
    <item>
      <title>99% of newbie developers are terrified of the Linux kernel.</title>
      <dc:creator>Somnath Das</dc:creator>
      <pubDate>Mon, 06 Jul 2026 06:26:12 +0000</pubDate>
      <link>https://dev.to/buildwithsomnath/99-of-newbie-developers-are-terrified-of-the-linux-kernel-4jma</link>
      <guid>https://dev.to/buildwithsomnath/99-of-newbie-developers-are-terrified-of-the-linux-kernel-4jma</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzd7ezi42rshi41xbwzve.png" class="article-body-image-wrapper"&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzd7ezi42rshi41xbwzve.png" alt=" " width="800" height="1000"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;They think it’s a chaotic maze reserved only for senior engineers with decades of experience.&lt;br&gt;
So they buy a 700-page textbook to learn how Operating Systems work instead.&lt;/p&gt;

&lt;p&gt;But textbooks only give you theory.&lt;br&gt;
The Linux source code gives you reality.&lt;/p&gt;

&lt;p&gt;If you want to learn memory management, process scheduling, or file systems from scratch...&lt;br&gt;
There is no better masterclass in the world than exploring the codebase that runs the modern internet.&lt;/p&gt;

&lt;p&gt;You don’t have to read the massive 30-million-line modern tree on day one.&lt;br&gt;
Start with Linux 0.01. Or focus on a single, well-documented subsystem.&lt;/p&gt;

&lt;p&gt;Writing code teaches you syntax.&lt;br&gt;
Reading world-class, battle-tested code teaches you architecture, trade-offs, and survival.&lt;/p&gt;

&lt;p&gt;It forces you to understand how software physically interacts with the silicon.&lt;br&gt;
No bloated abstractions. No hand-holding. Just pure, foundational engineering.&lt;/p&gt;

&lt;p&gt;The developers who learn to navigate the kernel don't just become better programmers.&lt;br&gt;
They become engineers who stop guessing why a system is failing, and start knowing exactly where to look.&lt;/p&gt;

&lt;p&gt;Have you ever tried diving into the Linux source code?&lt;br&gt;
Let me know in the comments.&lt;/p&gt;

</description>
      <category>linux</category>
      <category>opensource</category>
      <category>kernel</category>
      <category>developers</category>
    </item>
    <item>
      <title>Seeing Code in the Real World: The Bus Seating Problem 🚌</title>
      <dc:creator>Somnath Das</dc:creator>
      <pubDate>Sat, 27 Jun 2026 10:19:10 +0000</pubDate>
      <link>https://dev.to/buildwithsomnath/seeing-code-in-the-real-world-the-bus-seating-problem-31aa</link>
      <guid>https://dev.to/buildwithsomnath/seeing-code-in-the-real-world-the-bus-seating-problem-31aa</guid>
      <description>&lt;p&gt;Working in software development, it is hard to turn off the logic center of the brain. Have you ever looked at a completely normal, everyday situation and thought, "Wait, there's an algorithm for this"?&lt;/p&gt;

&lt;p&gt;That happened to me recently on a simple bus ride.&lt;/p&gt;

&lt;p&gt;I observed a family getting on the bus and trying to figure out their seating arrangement. Because of the way they sat, one child was left sitting alone. My brain immediately started crunching the numbers—mathematically, there was absolutely a way to seat them all safely!&lt;/p&gt;

&lt;p&gt;I decided to turn this real-world observation into a custom coding problem. I call it The Bus Seating Problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  📝 The Scenario &amp;amp; Rules
&lt;/h3&gt;

&lt;p&gt;Imagine an empty bus with paired seats. A group boards consisting of &lt;code&gt;n&lt;/code&gt; adults (parents) and &lt;code&gt;m&lt;/code&gt; children.&lt;/p&gt;

&lt;p&gt;To make this a solid algorithmic challenge, let's establish some strict baseline constraints:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Both n and m are greater than 1 (at least 2 adults and 2 children).&lt;/li&gt;
&lt;li&gt;The children always outnumber the adults (m &amp;gt; n).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here are the survival rules for seating:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Two children can sit together safely.&lt;/li&gt;
&lt;li&gt;No two adults can sit together.&lt;/li&gt;
&lt;li&gt;A child CANNOT sit alone. They must sit with another child or an adult.&lt;/li&gt;
&lt;li&gt;Adults can sit with children.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Objective: Given &lt;code&gt;n&lt;/code&gt; and &lt;code&gt;m&lt;/code&gt;, is it possible to seat everyone safely?&lt;/p&gt;

&lt;p&gt;Solutions : &lt;a href="https://github.com/buildwithsomnath/everyday-algorithms" rel="noopener noreferrer"&gt;https://github.com/buildwithsomnath/everyday-algorithms&lt;/a&gt;&lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>cpp</category>
      <category>problemsolvin</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>🚀 How to Solve Arrays and Hashing Problems in Data Structure?</title>
      <dc:creator>Somnath Das</dc:creator>
      <pubDate>Sun, 10 May 2026 03:09:58 +0000</pubDate>
      <link>https://dev.to/buildwithsomnath/how-to-solve-arrays-and-hashing-problems-in-data-structure-4fk6</link>
      <guid>https://dev.to/buildwithsomnath/how-to-solve-arrays-and-hashing-problems-in-data-structure-4fk6</guid>
      <description>&lt;p&gt;Arrays and Hashing are among the most important topics in &lt;strong&gt;Data Structures &amp;amp; Algorithms (DSA)&lt;/strong&gt; and are frequently asked in coding interviews at companies like FAANG, startups, and product-based companies. Here’s a simple roadmap to master them 👇&lt;/p&gt;

&lt;h3&gt;
  
  
  📌 1. Understand the Problem Type
&lt;/h3&gt;

&lt;p&gt;Before coding, identify the pattern:&lt;br&gt;
✅ Searching elements&lt;br&gt;
✅ Frequency counting&lt;br&gt;
✅ Duplicate detection&lt;br&gt;
✅ Pair/target sum problems&lt;br&gt;
✅ Prefix sum or subarray problems&lt;br&gt;
✅ Grouping &amp;amp; mapping&lt;/p&gt;

&lt;h3&gt;
  
  
  📌 2. Master Array Basics
&lt;/h3&gt;

&lt;p&gt;Arrays are all about &lt;strong&gt;indexing and traversal&lt;/strong&gt;. Focus on:&lt;br&gt;
🔹 Traversing efficiently&lt;br&gt;
🔹 Sorting techniques&lt;br&gt;
🔹 Two-pointer approach&lt;br&gt;
🔹 Sliding Window technique&lt;br&gt;
🔹 Prefix Sum optimization&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example Problems:&lt;/strong&gt;&lt;br&gt;
✔ Two Sum&lt;br&gt;
✔ Best Time to Buy &amp;amp; Sell Stock&lt;br&gt;
✔ Maximum Subarray&lt;br&gt;
✔ Product of Array Except Self&lt;/p&gt;

&lt;h3&gt;
  
  
  📌 3. Learn Hashing (HashMap / Dictionary / Set)
&lt;/h3&gt;

&lt;p&gt;Hashing helps reduce time complexity from &lt;strong&gt;O(n²) → O(n)&lt;/strong&gt; by storing values smartly.&lt;/p&gt;

&lt;p&gt;Use:&lt;br&gt;
🔹 &lt;strong&gt;unordered_map&lt;/strong&gt; → key-value storage&lt;br&gt;
🔹 &lt;strong&gt;unordered_set&lt;/strong&gt; → unique elements checking&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When to use hashing?&lt;/strong&gt;&lt;br&gt;
👉 Fast lookup required&lt;br&gt;
👉 Counting frequencies&lt;br&gt;
👉 Finding duplicates&lt;br&gt;
👉 Tracking visited elements&lt;/p&gt;

&lt;h3&gt;
  
  
  📌 Example Code (Two Sum using Hashing in C++)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;vector&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
#include&lt;/span&gt; &lt;span class="cpf"&gt;&amp;lt;unordered_map&amp;gt;&lt;/span&gt;&lt;span class="cp"&gt;
&lt;/span&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="k"&gt;namespace&lt;/span&gt; &lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;twoSum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;unordered_map&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;mp&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;size&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;complement&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;complement&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;mp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;end&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;mp&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;complement&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="n"&gt;mp&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{};&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;vector&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;twoSum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;"Indices: "&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ans&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;" "&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✅ &lt;strong&gt;Time Complexity:&lt;/strong&gt; O(n)&lt;br&gt;
✅ &lt;strong&gt;Space Complexity:&lt;/strong&gt; O(n)&lt;/p&gt;

&lt;h3&gt;
  
  
  📌 4. Follow This Problem-Solving Strategy
&lt;/h3&gt;

&lt;p&gt;1️⃣ Read the problem carefully&lt;br&gt;
2️⃣ Spend &lt;strong&gt;at least 30 minutes&lt;/strong&gt; trying to solve it yourself&lt;br&gt;
3️⃣ Do &lt;strong&gt;dry runs&lt;/strong&gt; with sample test cases on paper&lt;br&gt;
4️⃣ If stuck, try solving the &lt;strong&gt;brute force approach first&lt;/strong&gt;&lt;br&gt;
5️⃣ Then optimize using &lt;strong&gt;Arrays / Hashing techniques&lt;/strong&gt;&lt;br&gt;
6️⃣ Analyze &lt;strong&gt;Time Complexity &amp;amp; Space Complexity&lt;/strong&gt;&lt;br&gt;
7️⃣ Practice similar variations&lt;/p&gt;

&lt;h3&gt;
  
  
  📌 5. Golden Questions to Practice
&lt;/h3&gt;

&lt;p&gt;🔥 Two Sum&lt;br&gt;
🔥 Contains Duplicate&lt;br&gt;
🔥 Valid Anagram&lt;br&gt;
🔥 Group Anagrams&lt;br&gt;
🔥 Top K Frequent Elements&lt;br&gt;
🔥 Longest Consecutive Sequence&lt;/p&gt;

&lt;h3&gt;
  
  
  💡 Pro Tip:
&lt;/h3&gt;

&lt;p&gt;Whenever you see words like &lt;strong&gt;“frequency”&lt;/strong&gt;, &lt;strong&gt;“duplicate”&lt;/strong&gt;, &lt;strong&gt;“fast lookup”&lt;/strong&gt;, or &lt;strong&gt;“pair finding”&lt;/strong&gt;, think about &lt;strong&gt;HashMap/HashSet&lt;/strong&gt; instantly!&lt;/p&gt;

&lt;p&gt;Remember: &lt;strong&gt;Don’t jump to solutions too quickly.&lt;/strong&gt; Spending time thinking builds problem-solving skills. Even if you can’t solve the optimal solution, getting the &lt;strong&gt;brute force approach right is progress&lt;/strong&gt; 🚀&lt;/p&gt;

&lt;p&gt;💻 Consistency beats talent in DSA. Practice &lt;strong&gt;1–2 problems daily&lt;/strong&gt; and focus on patterns instead of memorizing solutions.&lt;/p&gt;

</description>
      <category>datastructures</category>
      <category>requestforpost</category>
      <category>hashing</category>
      <category>challenge</category>
    </item>
    <item>
      <title>🌿 AI-Powered Plant Disease Detection System</title>
      <dc:creator>Somnath Das</dc:creator>
      <pubDate>Mon, 30 Mar 2026 15:03:25 +0000</pubDate>
      <link>https://dev.to/buildwithsomnath/ai-powered-plant-disease-detection-system-23gj</link>
      <guid>https://dev.to/buildwithsomnath/ai-powered-plant-disease-detection-system-23gj</guid>
      <description>&lt;p&gt;Agriculture and Artificial Intelligence are coming together to solve real-world problems! In this project, I built a &lt;strong&gt;Plant Disease Detection System&lt;/strong&gt; using &lt;strong&gt;Deep Learning (CNN)&lt;/strong&gt; that can identify plant diseases from leaf images and provide actionable insights like treatment and fertilizer recommendations.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔍 What This Project Does
&lt;/h2&gt;

&lt;p&gt;The workflow is simple and effective:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Upload a plant leaf image → Get disease prediction → Receive treatment guidance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This makes it highly useful for farmers, agricultural professionals, and even researchers looking for quick and reliable plant health analysis.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 Key Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🔍 &lt;strong&gt;Real-time Disease Detection&lt;/strong&gt; using Convolutional Neural Networks&lt;/li&gt;
&lt;li&gt;🎯 &lt;strong&gt;81–84% Accuracy&lt;/strong&gt; across 38 plant disease classes&lt;/li&gt;
&lt;li&gt;💊 &lt;strong&gt;Treatment &amp;amp; Prevention Recommendations&lt;/strong&gt; tailored to predictions&lt;/li&gt;
&lt;li&gt;📊 &lt;strong&gt;Prediction History Tracking&lt;/strong&gt; with timestamps&lt;/li&gt;
&lt;li&gt;📱 &lt;strong&gt;Responsive Design&lt;/strong&gt; (Desktop, Tablet, Mobile)&lt;/li&gt;
&lt;li&gt;🚀 &lt;strong&gt;REST API Support&lt;/strong&gt; for integration with mobile apps&lt;/li&gt;
&lt;li&gt;🔐 &lt;strong&gt;Security Focused&lt;/strong&gt; (CSRF protection, file validation, input sanitization)&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🌾 Supported Plants &amp;amp; Diseases
&lt;/h2&gt;

&lt;p&gt;The model currently supports &lt;strong&gt;38 disease classes across multiple crops&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🍅 &lt;strong&gt;Tomato&lt;/strong&gt; – 10 disease classes&lt;/li&gt;
&lt;li&gt;🥔 &lt;strong&gt;Potato&lt;/strong&gt; – 3 disease classes&lt;/li&gt;
&lt;li&gt;🌽 &lt;strong&gt;Corn&lt;/strong&gt; – 4 disease classes&lt;/li&gt;
&lt;li&gt;🌶️ &lt;strong&gt;Pepper&lt;/strong&gt; – 2 disease classes&lt;/li&gt;
&lt;li&gt;🍎 &lt;strong&gt;Other crops&lt;/strong&gt; also included&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Backend:&lt;/strong&gt; Django&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Machine Learning:&lt;/strong&gt; TensorFlow, CNN&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Languages:&lt;/strong&gt; Python&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontend:&lt;/strong&gt; HTML, CSS&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API:&lt;/strong&gt; RESTful services&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🎯 Goal of This Project
&lt;/h2&gt;

&lt;p&gt;The main goal is to &lt;strong&gt;empower farmers with AI-driven tools&lt;/strong&gt; that can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Improve crop health&lt;/li&gt;
&lt;li&gt;Reduce agricultural losses&lt;/li&gt;
&lt;li&gt;Provide quick decision support&lt;/li&gt;
&lt;li&gt;Promote smart farming practices&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🔗 GitHub Repository
&lt;/h2&gt;

&lt;p&gt;Check out the full project here:&lt;br&gt;
👉 &lt;a href="https://github.com/buildwithsomnath/Plant-Disease-Detection/tree/main" rel="noopener noreferrer"&gt;https://github.com/buildwithsomnath/Plant-Disease-Detection/tree/main&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  📸 Screenshot
&lt;/h2&gt;

&lt;h2&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%2Farticles%2F5nwslmuqcwj7zhs1fhk0.png" alt="UI of the System" width="710" height="925"&gt;
&lt;/h2&gt;

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

&lt;p&gt;This project reflects my passion for &lt;strong&gt;Data Science, Machine Learning, and Full Stack Development&lt;/strong&gt;, and how these skills can be used to build impactful real-world solutions.&lt;/p&gt;

&lt;p&gt;If you found this interesting or have suggestions, feel free to share your thoughts. I’d love to collaborate and improve this further!&lt;/p&gt;




&lt;h2&gt;
  
  
  🏷️ Tags
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;#AI&lt;/code&gt; &lt;code&gt;#MachineLearning&lt;/code&gt; &lt;code&gt;#DeepLearning&lt;/code&gt; &lt;code&gt;#ComputerVision&lt;/code&gt; &lt;code&gt;#Django&lt;/code&gt; &lt;code&gt;#TensorFlow&lt;/code&gt; &lt;code&gt;#DataScience&lt;/code&gt; &lt;code&gt;#AgricultureTech&lt;/code&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>tensorflow</category>
      <category>deeplearning</category>
      <category>computervision</category>
    </item>
  </channel>
</rss>
