BackmediumStrings Accenture

Reverse Substring Concatenation Solution

Problem Statement

Given a string `s` of length `n`, return a comma-separated string of all substrings of `s` in reverse order, where each substring in the output string should be in reverse order.

Example 1
Input
abc
Output
c,b,a
Example 2
Input
abcd
Output
d,c,b,a

Constraints

  • 1 <= n <= 1000
  • s contains only lowercase English letters
  • s is not empty
  • n is a positive integer
Live Compiler
Loading...
Test Cases & Output
🔒 Sign up to run your code

🚀 Practice this problem

Run code, get AI hints & track streak

Sign Up Free