{"id":"1114e00b-6588-4440-89b3-11cd2be35b1e","name":"Abbreviation 1 - Using Bits","description":"1. You are given a word.\r\n2. You have to generate all abbrevations of that word.\r\nNote - Use bit manipulation","inputFormat":"A string representing a word","outputFormat":"Check the sample ouput and question video.","constraints":"1 &lt;= length of string &lt;= 32","sampleCode":{"cpp":{"code":"#include<bits/stdc++.h>\nusing namespace std;\n\n void solve(string str)\n {\n \n }\n \n\tint main() {\n \n string str;\n cin>>str;\n solve(str);\n }"},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n public static void solve(String str){\r\n // write your code here\r\n }\r\n \r\n\tpublic static void main(String[] args) {\r\n Scanner scn = new Scanner(System.in);\r\n String str = scn.nextLine();\r\n solve(str);\r\n }\r\n}"},"python":{"code":""}},"points":10,"difficulty":"easy","sampleInput":"pep","sampleOutput":"pep\r\npe1\r\np1p\r\np2\r\n1ep\r\n1e1\r\n2p\r\n3","questionVideo":"https://www.youtube.com/embed/2F-c8F4TCOo?end=103","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":"f3e3dbef-d2b7-4f6d-b357-2ef3738e6c91","name":"Bit Manipulation For Intermediate","slug":"bit-manipulation-for-intermediate-9995","type":0},{"id":"3331b72d-3714-47b3-8ade-d3587c4832df","name":"Abbreviation 1 - Using Bits","slug":"abbreviation-1-using-bits","type":1}],"next":{"id":"2df91ecd-d423-410e-9bb9-7cc7b33aadaa","name":"Abbreviation 1 - Using Bits MCQ","type":0,"slug":"abbreviation-1-using-bits-mcq"},"prev":{"id":"ad3302ef-9cc0-4e3c-a528-a58153da9161","name":"XOR of Sum of All Pairs","type":3,"slug":"xor-of-sum-of-all-pairs"}}}

Abbreviation 1 - Using Bits

1. You are given a word. 2. You have to generate all abbrevations of that word. Note - Use bit manipulation

{"id":"1114e00b-6588-4440-89b3-11cd2be35b1e","name":"Abbreviation 1 - Using Bits","description":"1. You are given a word.\r\n2. You have to generate all abbrevations of that word.\r\nNote - Use bit manipulation","inputFormat":"A string representing a word","outputFormat":"Check the sample ouput and question video.","constraints":"1 &lt;= length of string &lt;= 32","sampleCode":{"cpp":{"code":"#include<bits/stdc++.h>\nusing namespace std;\n\n void solve(string str)\n {\n \n }\n \n\tint main() {\n \n string str;\n cin>>str;\n solve(str);\n }"},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n public static void solve(String str){\r\n // write your code here\r\n }\r\n \r\n\tpublic static void main(String[] args) {\r\n Scanner scn = new Scanner(System.in);\r\n String str = scn.nextLine();\r\n solve(str);\r\n }\r\n}"},"python":{"code":""}},"points":10,"difficulty":"easy","sampleInput":"pep","sampleOutput":"pep\r\npe1\r\np1p\r\np2\r\n1ep\r\n1e1\r\n2p\r\n3","questionVideo":"https://www.youtube.com/embed/2F-c8F4TCOo?end=103","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":"f3e3dbef-d2b7-4f6d-b357-2ef3738e6c91","name":"Bit Manipulation For Intermediate","slug":"bit-manipulation-for-intermediate-9995","type":0},{"id":"3331b72d-3714-47b3-8ade-d3587c4832df","name":"Abbreviation 1 - Using Bits","slug":"abbreviation-1-using-bits","type":1}],"next":{"id":"2df91ecd-d423-410e-9bb9-7cc7b33aadaa","name":"Abbreviation 1 - Using Bits MCQ","type":0,"slug":"abbreviation-1-using-bits-mcq"},"prev":{"id":"ad3302ef-9cc0-4e3c-a528-a58153da9161","name":"XOR of Sum of All Pairs","type":3,"slug":"xor-of-sum-of-all-pairs"}}}
plane

Editor


Loading...

Abbreviation 1 - Using Bits

easy

1. You are given a word. 2. You have to generate all abbrevations of that word. Note - Use bit manipulation

Constraints

1 <= length of string <= 32

Format

Input

A string representing a word

Output

Check the sample ouput and question video.

Example

Sample Input

pep

Sample Output

pep pe1 p1p p2 1ep 1e1 2p 3

Question Video

Discussions

Show Discussion

Related Resources

related resources

Turning Off Zen Mode