ReverseParenthese | CodeFights Intro Algorithm JavaScript Solution and Breakdown

ReverseParenthesis | CodeFights Intro Algorithm JavaScript Solution and Breakdown
Support our Community:
-Code, Tech and Caffeine Facebook Group:
– Looking for a a Bootcamp check out DevMountain’s program where housing is included with the tuition:

Tutoring, Mentoring and Course Walkthroughs available:

Thank you to my Patreon Supporters Below:
-Check out

Support me and visit my store at:

Internship, Part-Time, & Full time work for college students and recent grads:

Fan funding goes towards buying the equipment necessary to deliver 4k videos, 4k webcam, and a high quality microphone better audio. Any support is very appreciated!

My channel is here for aspiring programmers to learn easier and help debug any issues from the many great free resources available on the web.

Check out my other videos going over HTML, CSS, Ruby, Ruby on Rails, Java, JavaScript, Python, PHP, SQL, Command Line, BootStrap, jQuery, and WordPress from CodeCademy, CodeCombat, FreeCodecamp and more!

Please watch: “How I Became a Developer | My Developer Journey of the Last 3 Years | Ask a Dev”



9 thoughts on “ReverseParenthese | CodeFights Intro Algorithm JavaScript Solution and Breakdown

  1. I tried it without regex, something like this

    const reverseParentheses1 = str => {
    if(!str.includes('(')) return str;
    let subStr = str;
    let revStr = '';
    subStr = subStr.substring(subStr.indexOf('(') + 1, subStr.indexOf(')') + 1);
    subStr = '(' + subStr;
    revStr = subStr.substring(1, subStr.length – 1).split('').reverse().join('');
    str = str.replace(subStr, revStr)
    return reverseParentheses1(str);

  2. We can try using Stack data structure as it has Last In First Out property. Which is useful during reversal of anything.

Leave a Reply

Your email address will not be published. Required fields are marked *