<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Venkateshwara on Medium]]></title>
        <description><![CDATA[Stories by Venkateshwara on Medium]]></description>
        <link>https://medium.com/@gvsharma4?source=rss-3027eb5f1293------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YJ1oNfBFUIvrzSWE-yLZlA.jpeg</url>
            <title>Stories by Venkateshwara on Medium</title>
            <link>https://medium.com/@gvsharma4?source=rss-3027eb5f1293------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 06:25:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gvsharma4/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Longest Palindromic SubString]]></title>
            <link>https://medium.com/@gvsharma4/longest-palindromic-substring-72b8f27d2239?source=rss-3027eb5f1293------2</link>
            <guid isPermaLink="false">https://medium.com/p/72b8f27d2239</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[data-structure-algorithm]]></category>
            <category><![CDATA[string]]></category>
            <dc:creator><![CDATA[Venkateshwara]]></dc:creator>
            <pubDate>Mon, 20 Jun 2022 13:00:37 GMT</pubDate>
            <atom:updated>2022-06-20T13:00:37.411Z</atom:updated>
            <content:encoded><![CDATA[<p>Intuition: Take two pointers and from every index in the given string go in both opposite direction.</p><p>the result would be odd if odd length is greater than or equal to even otherwise even.</p><pre>private static String getEven(String s, int L) {<br>    int l = 0;<br>    int h = 0;<br>    int diff = 0;<br>    String res = &quot;&quot;;<br>    for(int i=0;i&lt;L;i++){<br>        l = i;<br>        h = i+1;<br>        while((l &gt;= 0 &amp;&amp; h &lt; L) &amp;&amp; s.charAt(l) == s.charAt(h)) {<br>            l--;<br>            h++;<br>        }<br>        l++;<br>        if((h-l) &gt; diff) {<br>            diff = h-l;<br>            res = s.substring(l,h);<br>        }<br>    }<br>    if(res != null) {<br>        return res;<br>    } else {<br>        return s.substring(l,h);<br>    }<br>}</pre><pre>private static String getOdd(String s, int L) {<br>    int l = 0;<br>    int h = 0;<br>    int diff = 0;<br>    String res = &quot;&quot;;<br>    for(int i=0;i&lt;L;i++) {<br>        l = h = i;<br>        while((l &gt;= 0 &amp;&amp; h &lt; L) &amp;&amp; (s.charAt(l) == s.charAt(h))) {<br>            l--;<br>            h++;<br>        }<br>        l++;<br>        if((h-l) &gt; diff) {<br>            diff = h - l;<br>            res = s.substring(l,h);<br>        }<br>    }<br>    if(res != &quot;&quot;) return res;<br>    return s.substring(l,h);<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72b8f27d2239" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>