India’s Best Job Seekers and Training Platform Forums Java Problems set Given a string, complete the given function…

  • Given a string, complete the given function…

  • Akash 

    Administrator
    at

    Given a string, complete the given function to recursively remove the adjacent duplicate characters and return the resultant string. If there are no characters left in the resultant string, return “-1” (without quotes).

    Sample Test Cases

    Sample Input: ABCCBCBA

    Output: ACBA

    Explanation: (ABCCBCBA –> ABBCBA –> ACBA)

    Sample Input: AA

    Sample Output: -1

Log in to reply.

Original Post
0 of 0 posts June 2018
Now
KodNest Training New Batch is starting on 21st September 2020. Attend one week free demo classes.Register Now

New Report

Close