<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>parenthesis &#8211; JSAlgorithm</title>
	<atom:link href="https://jsalgorithm.com/tag/parenthesis/feed/" rel="self" type="application/rss+xml" />
	<link>https://jsalgorithm.com</link>
	<description></description>
	<lastBuildDate>Tue, 12 May 2020 19:55:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.5.15</generator>
<site xmlns="com-wordpress:feed-additions:1">177240629</site>	<item>
		<title>Decode String</title>
		<link>https://jsalgorithm.com/2020/05/12/decode-string/</link>
					<comments>https://jsalgorithm.com/2020/05/12/decode-string/#respond</comments>
		
		<dc:creator><![CDATA[Ronald]]></dc:creator>
		<pubDate>Tue, 12 May 2020 19:55:11 +0000</pubDate>
				<category><![CDATA[Leetcode]]></category>
		<category><![CDATA[Parenthesis]]></category>
		<category><![CDATA[Recursion]]></category>
		<category><![CDATA[String]]></category>
		<category><![CDATA[leetcode]]></category>
		<category><![CDATA[parenthesis]]></category>
		<category><![CDATA[recursion]]></category>
		<category><![CDATA[string]]></category>
		<guid isPermaLink="false">http://50.19.13.106/?p=54</guid>

					<description><![CDATA[let decodeString = function(str) { if (str.indexOf("[") &#60; 0) { return str; } let openingIndex = []; let newStr = ""; for (let i = 0; i &#60; str.length; i++) { if (str[i] === "[") { openingIndex.push(i); newStr += str[i]; } else if (str[i] === "]") { let opening = openingIndex.pop(); let allMultipliers = str.substring(0, [&#8230;]]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-preformatted">let decodeString = function(str) {<br><br>    if (str.indexOf("[") &lt; 0) {<br>        return str;<br>    }<br><br>    let openingIndex = [];<br>    let newStr = "";<br>    for (let i = 0; i &lt; str.length; i++) {<br>        if (str[i] === "[") {<br>            openingIndex.push(i);<br>            newStr += str[i];<br>        }<br>        else if (str[i] === "]") {<br>            let opening = openingIndex.pop();<br>            let allMultipliers = str.substring(0, opening).match(/\d+/g);<br>            let multiplier = allMultipliers[allMultipliers.length - 1];<br>            let data = str.substring(opening + 1, i);<br>            if (data.indexOf("[") &lt; 0) {<br>                newStr = newStr.substring(0, newStr.lastIndexOf("[") - multiplier.length) + data.repeat(multiplier);<br>                console.log({opening, multiplier, data, newStr});<br>            }<br>            else {<br>                newStr += str[i];<br>            }<br>        }<br>        else {<br>            newStr += str[i];<br>        }<br>    }<br><br>    return decodeString(newStr);<br>};</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://jsalgorithm.com/2020/05/12/decode-string/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">54</post-id>	</item>
		<item>
		<title>Valid Parenthesis</title>
		<link>https://jsalgorithm.com/2020/05/11/valid-parenthesis/</link>
					<comments>https://jsalgorithm.com/2020/05/11/valid-parenthesis/#respond</comments>
		
		<dc:creator><![CDATA[Ronald]]></dc:creator>
		<pubDate>Mon, 11 May 2020 20:57:08 +0000</pubDate>
				<category><![CDATA[Leetcode]]></category>
		<category><![CDATA[Parenthesis]]></category>
		<category><![CDATA[String]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[leetcode]]></category>
		<category><![CDATA[parenthesis]]></category>
		<category><![CDATA[string]]></category>
		<guid isPermaLink="false">http://50.19.13.106/?p=19</guid>

					<description><![CDATA[function validParenthesis(str) { let closingMap = { ')' : '(', ']' : '[', '}' : '{' } let chars = []; for(let i = 0; i &#60; str.length; i++) { if (str[i] === '(' &#124;&#124; str[i] === '[' &#124;&#124; str[i] === '{') { chars.push(str[i]); } else { let compare = chars.pop(); if (closingMap[str[i]] !== compare) [&#8230;]]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-preformatted">function validParenthesis(str) {<br><br>    let closingMap = {<br>        ')' : '(',<br>        ']' : '[',<br>        '}' : '{'<br>    }<br><br>    let chars = [];<br>    for(let i = 0; i &lt; str.length; i++) {<br>        if (str[i] === '(' || str[i] === '[' || str[i] === '{') {<br>            chars.push(str[i]);<br>        }<br>        else {<br>            let compare = chars.pop();<br>            if (closingMap[str[i]] !== compare) return false;<br>        }<br>    }<br>    return chars.length === 0;<br>}</pre>
]]></content:encoded>
					
					<wfw:commentRss>https://jsalgorithm.com/2020/05/11/valid-parenthesis/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">19</post-id>	</item>
	</channel>
</rss>
