`{"id":"a8c4246c-0b71-44a5-90af-8354456ad643","name":"Distinct Transformations","description":"1. You will be given 2 strings s and t\r\n 2. You need to find count of unique ways one can make a subsequence from s that is an identical to t \r\n 3. Find and return all unique ways\r\n 4. Input and output is handled for you\r\n 5. It is a functional problem ,please do not modify main()","inputFormat":"Input is handled for you","outputFormat":"Output is handled for you","constraints":"1&lt;=s,t length &lt;=100","sampleCode":{"cpp":{"code":"#include<iostream>\r\n using namespace std;\r\n \r\n \r\n // -----------------------------------------------------\r\n // This is a functional problem. Only this function has to be written.\r\n // This function takes as input 2 strings \r\n // It should return the required output\r\n void function(string S, string T){\r\n //Write your code here\r\n \r\n }\r\n \r\n \r\n int main(int argc,char**argv){\r\n \t string s,t;\r\n cin>>s>>t;\r\n \t function(s, t);\r\n }"},"java":{"code":"import java.util.*;\r\n \r\n class Main {\r\n \t public static void main (String[] args) {\r\n \t Scanner sc=new Scanner(System.in);\r\n \t String s=sc.next();\r\n \t String t=sc.next();\r\n \t function(s, t);\r\n \t }\r\n \t \t // -----------------------------------------------------\r\n \t // This is a functional problem. Only this function has to be written.\r\n \t // This function takes as input 2 strings \r\n \t // It should return the required output\r\n \r\n \t public static void function(String S, String T){\r\n \t \t //Write your code here\r\n \t }\r\n }"}},"points":10,"difficulty":"easy","sampleInput":"aaabbc\nabc","sampleOutput":"6","questionVideo":null,"hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"5539a6e8-c8bf-4f04-805c-e43e9d20e72a","name":"Dynamic Programming For Intermediate","slug":"dynamic-programming-for-intermediate-408","type":0},{"id":"8a95fd26-1b31-40a3-9f15-89ee6d4f9144","name":"Distinct Transformations","slug":"distinct-transformations","type":1}],"next":{"id":"cf7c618b-cce6-427c-8658-de61ebdb6f58","name":"Distinct transformations MCQ","type":0,"slug":"distinct-transformations-mcq"},"prev":{"id":"e504500f-4812-4a66-8720-3546e78bcda4","name":"Maximum Sum Subarray With Atleast K Elements","type":3,"slug":"maximum-sum-subarray-with-atleast-k-elements"}}}`

# Distinct Transformations

1. You will be given 2 strings s and t 2. You need to find count of unique ways one can make a subsequence from s that is an identical to t 3. Find and return all unique ways 4. Input and output is handled for you 5. It is a functional problem ,please do not modify main()

`{"id":"a8c4246c-0b71-44a5-90af-8354456ad643","name":"Distinct Transformations","description":"1. You will be given 2 strings s and t\r\n 2. You need to find count of unique ways one can make a subsequence from s that is an identical to t \r\n 3. Find and return all unique ways\r\n 4. Input and output is handled for you\r\n 5. It is a functional problem ,please do not modify main()","inputFormat":"Input is handled for you","outputFormat":"Output is handled for you","constraints":"1&lt;=s,t length &lt;=100","sampleCode":{"cpp":{"code":"#include<iostream>\r\n using namespace std;\r\n \r\n \r\n // -----------------------------------------------------\r\n // This is a functional problem. Only this function has to be written.\r\n // This function takes as input 2 strings \r\n // It should return the required output\r\n void function(string S, string T){\r\n //Write your code here\r\n \r\n }\r\n \r\n \r\n int main(int argc,char**argv){\r\n \t string s,t;\r\n cin>>s>>t;\r\n \t function(s, t);\r\n }"},"java":{"code":"import java.util.*;\r\n \r\n class Main {\r\n \t public static void main (String[] args) {\r\n \t Scanner sc=new Scanner(System.in);\r\n \t String s=sc.next();\r\n \t String t=sc.next();\r\n \t function(s, t);\r\n \t }\r\n \t \t // -----------------------------------------------------\r\n \t // This is a functional problem. Only this function has to be written.\r\n \t // This function takes as input 2 strings \r\n \t // It should return the required output\r\n \r\n \t public static void function(String S, String T){\r\n \t \t //Write your code here\r\n \t }\r\n }"}},"points":10,"difficulty":"easy","sampleInput":"aaabbc\nabc","sampleOutput":"6","questionVideo":null,"hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"5539a6e8-c8bf-4f04-805c-e43e9d20e72a","name":"Dynamic Programming For Intermediate","slug":"dynamic-programming-for-intermediate-408","type":0},{"id":"8a95fd26-1b31-40a3-9f15-89ee6d4f9144","name":"Distinct Transformations","slug":"distinct-transformations","type":1}],"next":{"id":"cf7c618b-cce6-427c-8658-de61ebdb6f58","name":"Distinct transformations MCQ","type":0,"slug":"distinct-transformations-mcq"},"prev":{"id":"e504500f-4812-4a66-8720-3546e78bcda4","name":"Maximum Sum Subarray With Atleast K Elements","type":3,"slug":"maximum-sum-subarray-with-atleast-k-elements"}}}`

Editor

# Distinct Transformations

easy

1. You will be given 2 strings s and t 2. You need to find count of unique ways one can make a subsequence from s that is an identical to t 3. Find and return all unique ways 4. Input and output is handled for you 5. It is a functional problem ,please do not modify main()

## Constraints

1<=s,t length <=100

## Format

### Input

Input is handled for you

### Output

Output is handled for you

## Example

Sample Input

```.css-23h8hz{color:inherit;font-size:0.875rem;line-height:1.125rem;letter-spacing:0.016rem;font-weight:var(--chakra-fontWeights-normal);white-space:pre-wrap;}aaabbc abc```

### Sample Output

`.css-3oaykw{color:var(--chakra-colors-active-primary);font-size:0.875rem;line-height:1.125rem;letter-spacing:0.016rem;font-weight:var(--chakra-fontWeights-normal);white-space:pre-wrap;font-family:Monospace;}6`

Discussions

Show Discussion

Related Resources