<?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: Muhammad Zeeshan</title>
    <description>The latest articles on DEV Community by Muhammad Zeeshan (@mzeeshan138).</description>
    <link>https://dev.to/mzeeshan138</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%2F3230417%2F15b945df-596a-484a-8260-2140006a0401.jpg</url>
      <title>DEV Community: Muhammad Zeeshan</title>
      <link>https://dev.to/mzeeshan138</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mzeeshan138"/>
    <language>en</language>
    <item>
      <title>Dummy post testing purpose</title>
      <dc:creator>Muhammad Zeeshan</dc:creator>
      <pubDate>Thu, 19 Jun 2025 06:27:26 +0000</pubDate>
      <link>https://dev.to/mzeeshan138/dummy-post-testing-purpose-2jhc</link>
      <guid>https://dev.to/mzeeshan138/dummy-post-testing-purpose-2jhc</guid>
      <description>&lt;p&gt;For many enterprise developers, the command-line (shell) is still the fastest and most direct way to get things done. New tools are now bringing AI into this familiar environment: shell-based coding agents run right in your terminal, offering natural-language code assistance without dragging you out of your workflow. In short, shell-based agents supercharge the tools you already use.&lt;/p&gt;

</description>
      <category>cli</category>
      <category>ai</category>
      <category>shell</category>
      <category>tooling</category>
    </item>
    <item>
      <title>🔁 9-Palindrome Number || Efficient Half-Reversal || Runtime 3 ms (beats 98.66%) · Memory 63.98 MB (beats 78.96%) 🏆</title>
      <dc:creator>Muhammad Zeeshan</dc:creator>
      <pubDate>Thu, 19 Jun 2025 05:53:33 +0000</pubDate>
      <link>https://dev.to/mzeeshan138/reasons-cli-coding-agents-are-the-future-of-software-development-p1b</link>
      <guid>https://dev.to/mzeeshan138/reasons-cli-coding-agents-are-the-future-of-software-development-p1b</guid>
      <description>&lt;h2&gt;
  
  
  🔗 Related Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;📝 My LeetCode Solution: &lt;a href="https://leetcode.com/problems/palindrome-number/solutions/6755711/efficient-half-reversal-palindrome-check-for-integers-3-ms-beats-98-66-63-98-mb-beats-78-96" rel="noopener noreferrer"&gt;9. Palindrome Number&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;👤 My LeetCode Profile: &lt;a href="https://leetcode.com/u/zeeshan138/" rel="noopener noreferrer"&gt;zeeshan138&lt;/a&gt; 🚀&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  LeetCode Submission Results
&lt;/h1&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Metric&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;th&gt;Percentile&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Runtime&lt;/td&gt;
&lt;td&gt;3 ms&lt;/td&gt;
&lt;td&gt;98.66%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Memory&lt;/td&gt;
&lt;td&gt;63.98 MB&lt;/td&gt;
&lt;td&gt;78.96%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Explanation of Key Points
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Early exits&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Any negative number is not a palindrome (e.g., &lt;code&gt;-121&lt;/code&gt; → &lt;code&gt;false&lt;/code&gt;).
&lt;/li&gt;
&lt;li&gt;Any number ending in &lt;code&gt;0&lt;/code&gt; can’t be a palindrome unless it’s &lt;code&gt;0&lt;/code&gt; itself (e.g., &lt;code&gt;10&lt;/code&gt; → &lt;code&gt;false&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Reversing half the number&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Iteratively remove the last digit from &lt;code&gt;x&lt;/code&gt; and append it to &lt;code&gt;reverted&lt;/code&gt;.
&lt;/li&gt;
&lt;li&gt;Continue until the remaining part (&lt;code&gt;x&lt;/code&gt;) is less than or equal to the reversed half (&lt;code&gt;reverted&lt;/code&gt;), meaning we've processed at least half of the digits.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Handling odd/even length&lt;/strong&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Even length&lt;/strong&gt;: The two halves must match exactly (&lt;code&gt;x === reverted&lt;/code&gt;).
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Odd length&lt;/strong&gt;: The reversed half contains the middle digit, so drop it with &lt;code&gt;Math.floor(reverted / 10)&lt;/code&gt; before comparing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This approach satisfies LeetCode’s constraints (−2³¹ ≤ x ≤ 2³¹−1) and avoids any string conversions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Complexity Analysis
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Time Complexity:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
The loop processes roughly half of the digits of &lt;code&gt;x&lt;/code&gt;. If &lt;code&gt;x&lt;/code&gt; has &lt;code&gt;d&lt;/code&gt; digits, it runs ~&lt;code&gt;d/2&lt;/code&gt; times → $$O(d) = O(\log_{10} x)$$.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Space Complexity:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Only a constant number of integer variables are used → $$O(1)$$.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




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



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
javascript
/**
 * @param {number} x
 * @return {boolean}
 */
var isPalindrome = function(x) {
    // Negative numbers or numbers ending with 0 (but not 0 itself) cannot be palindrome.
    if (x &amp;lt; 0 || (x % 10 === 0 &amp;amp;&amp;amp; x !== 0)) {
        return false;
    }
    let reverted = 0;
    // Reverse digits until the original number is &amp;lt;= reverted reversed half
    while (x &amp;gt; reverted) {
        reverted = reverted * 10 + (x % 10);
        x = Math.floor(x / 10);
    }
    // For even length: x === reverted
    // For odd length: x === Math.floor(reverted / 10)
    return x === reverted || x === Math.floor(reverted / 10);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>palindrome</category>
      <category>leetcode</category>
      <category>javascript</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
