<?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: Abhishek Kumar</title>
    <description>The latest articles on DEV Community by Abhishek Kumar (@abhishek_7303).</description>
    <link>https://dev.to/abhishek_7303</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%2F4194670%2F7ccd95d2-0137-4bb0-a7d0-1e0c60b7636f.png</url>
      <title>DEV Community: Abhishek Kumar</title>
      <link>https://dev.to/abhishek_7303</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abhishek_7303"/>
    <language>en</language>
    <item>
      <title>CP Sloth 🦥: Never Write DSA Edge Cases or Dry-Run Code Again (Local Gemma 3)</title>
      <dc:creator>Abhishek Kumar</dc:creator>
      <pubDate>Fri, 23 Oct 2026 17:52:09 +0000</pubDate>
      <link>https://dev.to/abhishek_7303/cp-sloth-never-write-dsa-edge-cases-or-dry-run-code-again-local-gemma-3-49gb</link>
      <guid>https://dev.to/abhishek_7303/cp-sloth-never-write-dsa-edge-cases-or-dry-run-code-again-local-gemma-3-49gb</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week3-2026-10-19"&gt;Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;Anyone who has solved Data Structures &amp;amp; Algorithms (DSA) problems on LeetCode, Codeforces, or GeeksforGeeks knows the two most tedious, energy-draining chores:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Manually inventing tricky edge-case test inputs&lt;/strong&gt; (empty structures, single elements, alternating signs, duplicate values, and $10^9$ boundary traps) when your code fails on a hidden test case.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dry-running code by hand on paper&lt;/strong&gt; to calculate nested loop states and verify whether a solution is about to hit &lt;strong&gt;Time Limit Exceeded (TLE)&lt;/strong&gt; or an integer overflow.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Meet &lt;strong&gt;CP Sloth 🦥&lt;/strong&gt; — a Manifest V3 Chrome Extension powered by Google's open-weight &lt;strong&gt;Gemma 3 (4B)&lt;/strong&gt; model running locally via Ollama that channels pure developer laziness.&lt;/p&gt;

&lt;p&gt;Instead of spending 10 to 15 minutes manually writing test cases or tracing pointer logic, you click a single &lt;strong&gt;"🦥 Do the Thinking"&lt;/strong&gt; button in your browser toolbar while on any problem page. CP Sloth extracts the problem statement and constraints from your active browser tab, evaluates your pasted solution, and immediately produces:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;5 Nasty, Copy-Pasteable Edge Cases:&lt;/strong&gt; Boundary tests tailored directly to the problem's mathematical limits.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An Instant Complexity &amp;amp; TLE Verdict:&lt;/strong&gt; Time and space complexity breakdown plus alerts for integer overflow traps (such as forgetting &lt;code&gt;long long&lt;/code&gt; in C++).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Lazy Sloth Fix:&lt;/strong&gt; A quick two-line architectural adjustment to optimize your approach with minimal effort.&lt;/li&gt;
&lt;/ul&gt;

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

&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%2Fu7svwbpqrzbt07zbyxnu.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%2Fu7svwbpqrzbt07zbyxnu.png" alt=" " width="800" height="460"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqzfbcs56x0xfty9qgyse.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqzfbcs56x0xfty9qgyse.gif" alt=" " width="600" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How It Works in Action:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open any problem on LeetCode or Codeforces.&lt;/li&gt;
&lt;li&gt;Open &lt;strong&gt;CP Sloth&lt;/strong&gt; from the toolbar and paste your draft code (or leave it blank to analyze constraints only).&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;"🦥 Do the Thinking"&lt;/strong&gt;. Local Gemma 3 parses the DOM text, calculates potential bottleneck bounds, and renders the ready-to-use test inputs in 3 to 5 seconds.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/Abhi7303" rel="noopener noreferrer"&gt;
        Abhi7303
      &lt;/a&gt; / &lt;a href="https://github.com/Abhi7303/cp-sloth" rel="noopener noreferrer"&gt;
        cp-sloth
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;🦥 CP Sloth — Lazy DSA Edge-Case &amp;amp; TLE Analyzer&lt;/h1&gt;
&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;Automate the most exhausting part of LeetCode and Codeforces. Generate nasty boundary test cases and calculate algorithmic time/space bottlenecks in one click using local, open-weight AI.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a href="https://hacktoberfest.com/" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/23a0eee3294d2c7f2d970aff5df4577c66ac97c8c0317d4657e8dcd084dda25a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4861636b746f626572666573742d323032365f5765656b5f332d6f72616e67652e737667" alt="Hacktoberfest 2026"&gt;&lt;/a&gt;
&lt;a href="https://ollama.com/library/gemma3" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/fd14b2dab93c7db40a7abd8c4b8169317be98cbeb12d2cc6f117c12bc48c6049/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6f64656c2d47656d6d615f335f283442292d3432383546342e737667" alt="Model"&gt;&lt;/a&gt;
&lt;a href="https://ollama.com/" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/3ebe46045dd5579988f129e233cc1a510c86f37ebc8626a9276251d19f009f1f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f496e666572656e63652d4c6f63616c5f4f6c6c616d612d626c61636b2e737667" alt="Inference"&gt;&lt;/a&gt;
&lt;a href="https://developer.chrome.com/docs/extensions/mv3/" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/6b2a6802ba433d7b1e7cd745f35f3f175f75d5ce2e1e8c2aa13e198c0ff1850d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f457874656e73696f6e2d4d616e69666573745f56332d737563636573732e737667" alt="Platform"&gt;&lt;/a&gt;
&lt;a href="https://github.com/Abhi7303/cp-sloth/LICENSE" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667" alt="License: MIT"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;📖 Overview&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;When solving Data Structures &amp;amp; Algorithms (DSA) problems, two repetitive chores drain time and momentum:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Manually inventing boundary test cases&lt;/strong&gt; (single elements, duplicates, alternating negative integers, empty sets, or $10^9$ limits) when a submission fails on an opaque test case.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dry-running logic on paper&lt;/strong&gt; to detect whether an algorithm will trigger &lt;strong&gt;Time Limit Exceeded (TLE)&lt;/strong&gt; or an integer overflow trap (e.g., omitting &lt;code&gt;long long&lt;/code&gt; in C++).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;CP Sloth&lt;/strong&gt; is a lightweight Manifest V3 Chrome Extension designed for peak developer laziness. With a single click while viewing any problem page, it extracts constraints directly from the tab's DOM and sends them to a locally hosted &lt;strong&gt;Google Gemma 3 (4B)&lt;/strong&gt; model to evaluate bottlenecks…&lt;/p&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/Abhi7303/cp-sloth" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;&lt;em&gt;Direct Link: &lt;a href="https://github.com/Abhi7303/cp-sloth" rel="noopener noreferrer"&gt;https://github.com/Abhi7303/cp-sloth&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The project is lightweight and zero-dependency:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;manifest.json&lt;/code&gt;: Manifest V3 configuration with &lt;code&gt;activeTab&lt;/code&gt; and &lt;code&gt;scripting&lt;/code&gt; permissions.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;popup.html&lt;/code&gt;: Minimalist dark-mode UI with clipboard-ready formatting.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;popup.js&lt;/code&gt;: Injects content capture scripts into the current tab and streams queries to the local Ollama daemon.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;icon.png&lt;/code&gt;: Custom sloth extension branding.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;The entire stack is built around local open-weight AI and browser-native APIs:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The Brain (Google Gemma 3 - 4B):&lt;/strong&gt; I selected &lt;code&gt;gemma3:4b&lt;/code&gt; because it delivers strong mathematical and coding reasoning at an accessible ~3.4 GB footprint. It effortlessly parses problem boundaries ($N \le 2 \times 10^5$) and identifies asymptotic complexity without requiring a high-end cloud cluster.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Local Inference Engine (Ollama):&lt;/strong&gt; The extension connects directly to &lt;code&gt;http://localhost:11434/api/generate&lt;/code&gt;. Running Ollama with &lt;code&gt;OLLAMA_ORIGINS="*"&lt;/code&gt; enables cross-origin communication from the Chrome extension sandbox directly to Apple Metal hardware acceleration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Manifest V3 Tab Scraping:&lt;/strong&gt; Using &lt;code&gt;chrome.scripting.executeScript&lt;/code&gt;, CP Sloth captures the active tab's textual context (&lt;code&gt;document.body.innerText.slice(0, 4000)&lt;/code&gt;) directly from the problem page without requiring invasive background tracking scripts.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;Using an open-weight model running locally on consumer hardware completely outclasses closed cloud APIs for this use case:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;$0 Cost &amp;amp; Unlimited Iterations:&lt;/strong&gt; Grinding through a 300-question DSA list involves testing dozens of solutions each day. Calling proprietary cloud APIs for every test run would rack up ongoing API bills or hit strict hourly rate limits. Running an open-weight model locally costs &lt;strong&gt;$0 forever&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;100% Offline Capability:&lt;/strong&gt; Students and developers frequently practice in classrooms, libraries, or transit commutes with unstable Wi-Fi. Because the model weights live on local storage, CP Sloth operates at full speed with zero internet connection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Privacy &amp;amp; Ownership:&lt;/strong&gt; Draft solutions, private contest submissions, and browser contexts never leave &lt;code&gt;localhost&lt;/code&gt;. There is zero telemetry and no corporate data harvesting.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model Flexibility:&lt;/strong&gt; Because the inference layer connects to a standard Ollama endpoint, anyone can swap the backend to &lt;code&gt;qwen2.5-coder&lt;/code&gt; or a quantized &lt;code&gt;1b&lt;/code&gt; model by altering a single string in &lt;code&gt;popup.js&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Lazy Payoff
&lt;/h2&gt;

&lt;p&gt;During testing on dynamic programming and sliding window problems this week, CP Sloth cut edge-case debugging time from &lt;strong&gt;12 minutes down to under 5 seconds&lt;/strong&gt;. It caught an off-by-one error on single-element arrays and warned about an $O(N^2)$ worst-case skew on an un-memoized recursion tree before hitting submit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Best Use of Gemma:&lt;/strong&gt; CP Sloth is built around Google's open-weight &lt;strong&gt;Gemma 3 (&lt;code&gt;gemma3:4b&lt;/code&gt;)&lt;/strong&gt; running locally on consumer hardware to automate algorithm evaluation, boundary analysis, and complexity estimation.
&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%2Fxdrgcyk1wz8d7j5fp2b7.png" alt=" " width="800" height="485"&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
      <category>gemma</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
