Finding all substring from a string

I wrote my own code in n^2 complexity but it’s not working correctly. Can you plz check it.https://ide.codingblocks.com/s/174024

@Shortcuttohell
Hello Prabal,
here is your working code link - https://ide.codingblocks.com/s/174027
error
a) second argument of substr takes length which in your case should be j-i +1 but you were passing j+1
rest of your code was correct.
I hope you find this helpful