CP Sloth 🦥: Never Write DSA E... Note

CP Sloth 🦥: Never Write DSA Edge Cases or Dry-Run Code Again (Local Gemma 3)

CP Sloth is a Chrome Extension designed to automate tedious aspects of solving Data Structures and Algorithms (DSA) problems. It tackles the manual invention of edge-case test inputs and dry-running code for Time Limit Exceeded (TLE) or integer overflow issues. The extension is powered by Google's open-weight Gemma 3 (4B) model, running locally via Ollama. With a single click, CP Sloth extracts problem statements and constraints from any active LeetCode or Codeforces tab. It then evaluates the user's pasted solution to produce five nasty, copy-pasteable edge cases tailored to the problem's mathematical limits. Additionally, it provides an instant complexity and TLE verdict, including alerts for potential integer overflow traps. Finally, it offers a "Lazy Sloth Fix," suggesting a quick two-line architectural adjustment for optimization. The entire stack uses local open-weight AI and browser-native APIs, ensuring zero cost, unlimited iterations, and 100% offline capability. This approach prioritizes privacy and ownership, as draft solutions and browser contexts never leave the user's local machine. During testing, CP Sloth significantly reduced debugging time, catching critical errors like off-by-one errors and warning about suboptimal time complexities.
CdXz5zHNQW_gFnvQufojK.webp