<?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: Piyush Acharya</title>
    <description>The latest articles on DEV Community by Piyush Acharya (@verisimilitudex).</description>
    <link>https://dev.to/verisimilitudex</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F901067%2F5f861236-fc88-4fac-961c-47ab15ece20a.png</url>
      <title>DEV Community: Piyush Acharya</title>
      <link>https://dev.to/verisimilitudex</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/verisimilitudex"/>
    <language>en</language>
    <item>
      <title>Fastest Java Solution!! 🔥🔥🔥</title>
      <dc:creator>Piyush Acharya</dc:creator>
      <pubDate>Wed, 14 Jun 2023 17:35:23 +0000</pubDate>
      <link>https://dev.to/verisimilitudex/fastest-java-solution-5288</link>
      <guid>https://dev.to/verisimilitudex/fastest-java-solution-5288</guid>
      <description>&lt;h1&gt;
  
  
  Intuition
&lt;/h1&gt;

&lt;p&gt;This problem is really simple if you think about the 2 types of testcases. First, the number inputted can be divisible by 2. In this case, we can just return the number itself since it satisfies all of the criteria. Else, you can just return the number times 2.&lt;/p&gt;

&lt;h1&gt;
  
  
  Complexity
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Time complexity: O(1)&lt;/li&gt;
&lt;li&gt;Space complexity: O(1)&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Code
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Solution&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;smallestEvenMultiple&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>2648. LeetCode's Generate Fibonacci Sequence - JS Solution Beats 56% in Memory</title>
      <dc:creator>Piyush Acharya</dc:creator>
      <pubDate>Wed, 14 Jun 2023 16:55:20 +0000</pubDate>
      <link>https://dev.to/verisimilitudex/js-solution-beats-56-in-memory-kph</link>
      <guid>https://dev.to/verisimilitudex/js-solution-beats-56-in-memory-kph</guid>
      <description>&lt;h1&gt;
  
  
  Code
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/**
 * @return {Generator&amp;lt;number&amp;gt;}
 */
var fibGenerator = function*() {
    let a = 0, b = 1;
    yield a;
    yield b;

    while (true) {
        let c = a + b;
        a = b;
        b = c;
        yield c;
    }
};

/**
 * const gen = fibGenerator();
 * gen.next().value; // 0
 * gen.next().value; // 1
 */
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>FASTEST JAVA SOLUTION 🔥🔥🔥</title>
      <dc:creator>Piyush Acharya</dc:creator>
      <pubDate>Wed, 14 Jun 2023 16:26:06 +0000</pubDate>
      <link>https://dev.to/verisimilitudex/fastest-java-solution-418p</link>
      <guid>https://dev.to/verisimilitudex/fastest-java-solution-418p</guid>
      <description>&lt;h1&gt;
  
  
  Code
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Solution&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="nf"&gt;shuffle&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;newNums&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="o"&gt;];&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&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="o"&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;n&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; 
            &lt;span class="n"&gt;newNums&lt;/span&gt;&lt;span class="o"&gt;[&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;2&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;];&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&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="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;newNums&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;)];&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;newNums&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>2629. LeetCode's Function Composition - Linear Solution Beats 53%</title>
      <dc:creator>Piyush Acharya</dc:creator>
      <pubDate>Wed, 14 Jun 2023 16:02:56 +0000</pubDate>
      <link>https://dev.to/verisimilitudex/2629-leetcodes-function-composition-linear-solution-beats-53-gk5</link>
      <guid>https://dev.to/verisimilitudex/2629-leetcodes-function-composition-linear-solution-beats-53-gk5</guid>
      <description>&lt;h1&gt;
  
  
  Code
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/**
 * @param {Function[]} functions
 * @return {Function}
 */
var compose = function(functions) {
    return function(x) {
        for (var i = functions.length - 1; i &amp;gt;= 0; i--) {
            x = functions[i](x);
        }
        return x;
    }
};

/**
 * const fn = compose([x =&amp;gt; x + 1, x =&amp;gt; 2 * x])
 * fn(4) // 9
 */
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Fastest JS Solution - Beats 75% of Solutions with 50 MS Runtime</title>
      <dc:creator>Piyush Acharya</dc:creator>
      <pubDate>Wed, 14 Jun 2023 15:58:42 +0000</pubDate>
      <link>https://dev.to/verisimilitudex/fastest-js-solution-beats-75-of-solutions-with-50-ms-runtime-4nj9</link>
      <guid>https://dev.to/verisimilitudex/fastest-js-solution-beats-75-of-solutions-with-50-ms-runtime-4nj9</guid>
      <description>&lt;h1&gt;
  
  
  Intuition
&lt;/h1&gt;

&lt;p&gt;The code snippet is a JavaScript function that takes an array and a function as input and returns a new array with the function applied to each element of the input array.&lt;/p&gt;

&lt;h1&gt;
  
  
  Approach
&lt;/h1&gt;

&lt;p&gt;The approach used in the code snippet is to loop through each element of the input array and apply the given function to it. The result of the function is then stored in a new array.&lt;/p&gt;

&lt;h1&gt;
  
  
  Complexity
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Time complexity:
The time complexity of the map function is O(n), where n is the length of the input array. This is because the function loops through each element of the input array once and applies the given function to it.&lt;/li&gt;
&lt;li&gt;Space complexity:
The space complexity of the map function is O(n), where n is the length of the input array. This is because the function creates a new array of the same length as the input array to store the results of the function applied to each element of the input array.
# Code
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="cm"&gt;/**
 * @param {number[]} arr
 * @param {Function} fn
 * @return {number[]}
 */&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;map&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;newArr&lt;/span&gt; &lt;span class="o"&gt;=&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="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&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="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&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="nx"&gt;newArr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="nx"&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="nx"&gt;newArr&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;



</description>
    </item>
    <item>
      <title>JAVASCRIPT SOLUTION BEATS 83% IN MEMORY USAGE</title>
      <dc:creator>Piyush Acharya</dc:creator>
      <pubDate>Wed, 14 Jun 2023 15:50:17 +0000</pubDate>
      <link>https://dev.to/verisimilitudex/javascript-solution-beats-83-in-memory-usage-54pi</link>
      <guid>https://dev.to/verisimilitudex/javascript-solution-beats-83-in-memory-usage-54pi</guid>
      <description>&lt;h1&gt;
  
  
  Intuition
&lt;/h1&gt;

&lt;p&gt;The code snippet is a JavaScript implementation of the reduce() method for arrays. The reduce() method is used to apply a function to each element of an array and reduce the array to a single value.&lt;/p&gt;

&lt;h1&gt;
  
  
  Approach
&lt;/h1&gt;

&lt;p&gt;The reduce() method is called on an array and takes two arguments: a callback function and an initial value. The callback function is executed on each element of the array and takes two arguments: an accumulator and the current element. The accumulator is the value returned by the previous invocation of the callback function, or the initial value if it is the first invocation. The current element is the current element being processed in the array. The callback function returns a value that is used as the accumulator for the next invocation of the callback function. The reduce() method returns the final value of the accumulator after all elements of the array have been processed.&lt;/p&gt;

&lt;h1&gt;
  
  
  Complexity
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Time complexity:
The time complexity of the reduce() method is O(n), where n is the number of elements in the array. This is because the callback function is executed once for each element in the array.&lt;/li&gt;
&lt;li&gt;Space complexity:
The space complexity of the reduce() method is O(1), because it only uses a constant amount of additional space to store the accumulator and the current element.
# Code
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="cm"&gt;/**
 * @param {number[]} nums
 * @param {Function} fn
 * @param {number} init
 * @return {number}
 */&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;reduce&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;init&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;init&lt;/span&gt;
    &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&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="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&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="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;fn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;nums&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&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="nx"&gt;res&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;



</description>
    </item>
    <item>
      <title>2396. LeetCode's Strictly Palindromic Number - FASTEST JAVA SOLUTION - 0 MS RUNTIME ⏩⏩</title>
      <dc:creator>Piyush Acharya</dc:creator>
      <pubDate>Wed, 14 Jun 2023 15:44:39 +0000</pubDate>
      <link>https://dev.to/verisimilitudex/fastest-java-solution-0-ms-runtime-19cd</link>
      <guid>https://dev.to/verisimilitudex/fastest-java-solution-0-ms-runtime-19cd</guid>
      <description>&lt;h1&gt;
  
  
  Intuition
&lt;/h1&gt;

&lt;p&gt;The code seems to be checking if a given number is strictly palindromic in all bases from 2 to n-2.&lt;/p&gt;

&lt;h1&gt;
  
  
  Approach
&lt;/h1&gt;

&lt;p&gt;The code seems to be checking if a given number is strictly palindromic in all bases from 2 to n-2.&lt;/p&gt;

&lt;h1&gt;
  
  
  Complexity
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Time complexity: The time complexity of the convert method is O(log n), since it is converting the number to a different base. The time complexity of the isPalindrome method is O(log n), since it is checking if the number is a palindrome. The time complexity of the isStrictlyPalindromic method is O(n log n), since it is iterating through all bases from 2 to n-2, and for each base it is calling the convert and isPalindrome methods. Therefore, the overall time complexity is O(n log n).&lt;/li&gt;
&lt;li&gt;Space complexity: The space complexity of the convert method is O(log n), since it is creating a string representation of the number in a different base. The space complexity of the isPalindrome method is O(log n), since it is creating a string representation of the number. The space complexity of the isStrictlyPalindromic method is O(1), since it is only using a constant amount of space. Therefore, the overall space complexity is O(log n).&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Code
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Solution {
    public boolean isStrictlyPalindromic(int n) {
        int size = n - 2;
        for (int i = 2; i &amp;lt;= size; i++) {
            if (!isPalindrome(convert(n, i))) {
                return false;
            }
        }
        return true;
    }

    public long convert(int number, int base) {
        String binary = Integer.toString(number, base);
        return Long.parseLong(binary);
    }

    public Boolean isPalindrome(long number) {
        String num = Long.toString(number);
        int max = num.length() / 2;
        for (int i = 0; i &amp;lt; max; i++) {
            if (!(num.charAt(i) == num.charAt(num.length() - i - 1))) {
                return false;
            }
        }
        return true;
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>I'm approaching 1000 followers!</title>
      <dc:creator>Piyush Acharya</dc:creator>
      <pubDate>Wed, 14 Jun 2023 05:02:48 +0000</pubDate>
      <link>https://dev.to/verisimilitudex/im-approaching-1000-followers-11kj</link>
      <guid>https://dev.to/verisimilitudex/im-approaching-1000-followers-11kj</guid>
      <description>&lt;p&gt;Hey everyone, I have some amazing news to share with you all! I'm approaching 1000 followers on dev.to and I couldn't be more thankful for your support and engagement. You guys are awesome and I love reading your comments and messages. Thank you for being part of my journey and for making this community so wonderful. To celebrate this milestone, I'm going to do a Q&amp;amp;A session where you can ask me anything you want about my projects, skills, interests, or anything else. Just drop your questions in the comments below or DM me and I'll answer them in a video soon. I can't wait to hear from you and to share more of my thoughts and insights with you. Stay tuned and stay awesome! 😊&lt;/p&gt;

&lt;p&gt;P.S. If you haven't checked out my latest project, DNAnalyzer, please do so! It's a groundbreaking open source tool that brings the power of machine learning to DNA analysis. You can find it on &lt;a href="https://github.com/VerisimilitudeX/DNAnalyzer" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; or read more about it here on &lt;a href="https://dev.to/dnanalyzer/meet-dnai-a-ml-based-analysis-of-dna-3n8e"&gt;dev.to&lt;/a&gt;. I would love to hear your feedback and suggestions on how to make it better and more useful for everyone.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>devjournal</category>
    </item>
    <item>
      <title>2733. LeetCode's Neither Minimum nor Maximum - JAVA SOLUTION BEATS 100% OF SOLUTIONS IN BOTH RUNTIME AND MEMORY</title>
      <dc:creator>Piyush Acharya</dc:creator>
      <pubDate>Sun, 11 Jun 2023 04:02:49 +0000</pubDate>
      <link>https://dev.to/verisimilitudex/2733-leetcodes-neither-minimum-nor-maximum-java-solution-beats-100-of-solutions-in-both-runtime-and-memory-23ga</link>
      <guid>https://dev.to/verisimilitudex/2733-leetcodes-neither-minimum-nor-maximum-java-solution-beats-100-of-solutions-in-both-runtime-and-memory-23ga</guid>
      <description>&lt;h1&gt;
  
  
  Code
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Solution {
    public int findNonMinOrMax(int[] nums) {
        int max = Integer.MIN_VALUE;
        int min = Integer.MAX_VALUE;
        for (int i = 0; i &amp;lt; nums.length; i++) {
            if (nums[i] &amp;gt; max) {
                max = nums[i];
            } if (nums[i] &amp;lt; min) {
                min = nums[i];
            }
        }
        for (int i = 0; i &amp;lt; nums.length; i++) {
            if (nums[i] != max &amp;amp;&amp;amp; nums[i] != min) {
                return nums[i];
            }
        }
        return -1;
    }

    public static void main(String[] args) {
        Solution sol = new Solution();
        int[] nums = { 1, 2 };
        System.out.println(sol.findNonMinOrMax(nums));
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>programming</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>leetcode</category>
    </item>
    <item>
      <title>EXTREMELY SIMPLE &amp; LOGICAL JAVA SOLUTION BEATS 85% IN RUNTIME</title>
      <dc:creator>Piyush Acharya</dc:creator>
      <pubDate>Sat, 10 Jun 2023 22:48:46 +0000</pubDate>
      <link>https://dev.to/verisimilitudex/extremely-simple-logical-java-solution-beats-85-in-runtime-23ba</link>
      <guid>https://dev.to/verisimilitudex/extremely-simple-logical-java-solution-beats-85-in-runtime-23ba</guid>
      <description>&lt;h1&gt;
  
  
  Intuition
&lt;/h1&gt;

&lt;p&gt;The problem asks us to find the number of good pairs in an array. A good pair is defined as a pair (i, j) where &lt;code&gt;0 &amp;lt;= i &amp;lt; j &amp;lt; nums.length&lt;/code&gt; and &lt;code&gt;nums[i] == nums[j]&lt;/code&gt;. In other words, we need to count the number of occurrences of the same element in the array that have a lower index than another occurrence of the same element.&lt;/p&gt;

&lt;h1&gt;
  
  
  Approach
&lt;/h1&gt;

&lt;p&gt;One simple approach to solve this problem is to use nested loops to compare each pair of elements in the array and count the good pairs. The outer loop iterates over each element in the array, and the inner loop starts from the next element and compares it with the current element. If the elements are equal, we increment the count of good pairs.&lt;/p&gt;

&lt;h1&gt;
  
  
  Complexity
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Time complexity: O(n^2) - The nested loops iterate over all pairs of elements in the array, resulting in a quadratic time complexity.&lt;/li&gt;
&lt;li&gt;Space complexity: O(1) - We are using a constant amount of extra space to store the count of good pairs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Code
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Solution&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;numIdenticalPairs&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;goodPairs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&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="o"&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="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="o"&gt;=&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;1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&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="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;++)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;nums&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="o"&gt;])&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;goodPairs&lt;/span&gt;&lt;span class="o"&gt;++;&lt;/span&gt;
                &lt;span class="o"&gt;}&lt;/span&gt;
            &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;goodPairs&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: This code snippet is in Java.&lt;/p&gt;

</description>
      <category>leetcode</category>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>2716. LeetCode's Minimize String Length - FASTEST JAVA SOLUTION BEATS 100% OF SOLUTIONS!!!!</title>
      <dc:creator>Piyush Acharya</dc:creator>
      <pubDate>Mon, 05 Jun 2023 16:44:35 +0000</pubDate>
      <link>https://dev.to/verisimilitudex/fastest-java-solution-beats-100-of-solutions-38al</link>
      <guid>https://dev.to/verisimilitudex/fastest-java-solution-beats-100-of-solutions-38al</guid>
      <description>&lt;h1&gt;
  
  
  Intuition
&lt;/h1&gt;

&lt;p&gt;The problem is to find the minimum length of a string after removing all duplicate characters. One way to solve this problem is to use a boolean array to keep track of which characters have been seen before in the string. Then, we can iterate over the string and count how many unique characters there are. This will give us the minimum length of the string.&lt;/p&gt;

&lt;h1&gt;
  
  
  Approach
&lt;/h1&gt;

&lt;p&gt;We can use a boolean array of size 26 to represent the 26 lowercase letters in the alphabet. We initialize all the elements to false, meaning that we have not seen any character yet. Then, we convert the input string to a char array and loop through it. For each character, we check its corresponding index in the boolean array. If it is false, we set it to true and increment a counter variable. If it is true, we ignore it and move on to the next character. At the end of the loop, the counter variable will hold the number of unique characters in the string, which is also the minimum length of the string after removing duplicates.&lt;/p&gt;

&lt;h1&gt;
  
  
  Complexity
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Time complexity:&lt;br&gt;
The time complexity of this solution is $$O(n)$$, where n is the length of the input string. This is because we only need to loop through the string once and perform constant time operations for each character.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Space complexity:&lt;br&gt;
The space complexity of this solution is $$O(1)$$, because we only use a fixed size boolean array and a few variables that do not depend on the input size.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Code
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.ArrayList&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Solution&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;minimizedStringLength&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;characters&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;toCharArray&lt;/span&gt;&lt;span class="o"&gt;();&lt;/span&gt;
        &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="kt"&gt;boolean&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;seen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;26&lt;/span&gt;&lt;span class="o"&gt;];&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&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="o"&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;characters&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(!&lt;/span&gt;&lt;span class="n"&gt;seen&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;characters&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;97&lt;/span&gt;&lt;span class="o"&gt;])&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;seen&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;characters&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;97&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
                &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="o"&gt;++;&lt;/span&gt;     
            &lt;span class="o"&gt;}&lt;/span&gt;   
        &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;   
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>java</category>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>SIMPLE &amp; EFFICIENT Java Solution BEATS 95%</title>
      <dc:creator>Piyush Acharya</dc:creator>
      <pubDate>Mon, 05 Jun 2023 16:35:10 +0000</pubDate>
      <link>https://dev.to/verisimilitudex/simple-efficient-java-solution-beats-95-2184</link>
      <guid>https://dev.to/verisimilitudex/simple-efficient-java-solution-beats-95-2184</guid>
      <description>&lt;h1&gt;
  
  
  Intuition
&lt;/h1&gt;

&lt;p&gt;To solve this problem, I need to keep track of the value of x and update it according to the operations in the array.&lt;/p&gt;

&lt;h1&gt;
  
  
  Approach
&lt;/h1&gt;

&lt;p&gt;I will use a variable x to store the value of x and initialize it to zero. Then I will loop through the array of operations and use a switch statement to check each operation and increment or decrement x accordingly.&lt;/p&gt;

&lt;h1&gt;
  
  
  Complexity
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Time complexity:&lt;br&gt;
The time complexity is $$O(n)$$ where n is the length of the array, because I need to iterate through all the operations once.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Space complexity:&lt;br&gt;
The space complexity is $$O(1)$$ because I only use a constant amount of extra space for the variable x.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Code
&lt;/h1&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Solution&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
 &lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;finalValueAfterOperations&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;String&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;operations&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&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="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
 &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;size&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;operations&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;length&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// store the size of the array&lt;/span&gt;
 &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="o"&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="o"&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;size&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// use the size variable&lt;/span&gt;
 &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;operation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;operations&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;];&lt;/span&gt; &lt;span class="c1"&gt;// store the operation in a variable&lt;/span&gt;
 &lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;operation&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="c1"&gt;// use switch statement&lt;/span&gt;
 &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="s"&gt;"++X"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
 &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="s"&gt;"X++"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
 &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;++;&lt;/span&gt;
 &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
 &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="s"&gt;"--X"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
 &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="s"&gt;"X--"&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
 &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;--;&lt;/span&gt;
 &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
 &lt;span class="o"&gt;}&lt;/span&gt;
 &lt;span class="o"&gt;}&lt;/span&gt;
 &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
 &lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>java</category>
      <category>beginners</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
