diff --git a/Misc/ReturnSubsequence.java b/Misc/ReturnSubsequence.java new file mode 100644 index 00000000..ef3aaed0 --- /dev/null +++ b/Misc/ReturnSubsequence.java @@ -0,0 +1,59 @@ +/* +This program will return all the subsequences of the input string in a string array; +Sample Input: +abc +Sample Output: +"" ( Empty String ) +c +b +bc +a +ac +ab +abc + + */ + +import java.util.Scanner; + +public class ReturnSubsequence { + /* + Main function will accept the given string and implement return subsequences function + */ + public static void main(String[] args) { + System.out.println("Enter String: "); + Scanner s=new Scanner(System.in); + String givenString=s.next(); //given string + String[] subsequence=returnSubsequence(givenString); //calling returnSubsequence() function + System.out.println("Subsequences : "); + for(int i=0;i