Company: Barclays
Difficulty: medium
Binary String Conversion body { font-family: Arial, sans-serif; line-height: 1.6; margin: 20px; } .problem-container { max-width: 900px; margin: auto; padding: 20px; border: 1px solid #ddd; border-radius: 8px; background: #f9f9f9; } h1, h3 { color: #333; } pre { background: #f4f4f4; padding: 10px; border: 1px solid #ddd; border-radius: 5px; overflow-x: auto; } ul { margin: 0; padding-left: 20px; } .example { margin-top: 20px; } .example .input, .example .output { margin-bottom: 10px; } Binary String Conversion Emerson is very fond of strings, and he keeps trying to reverse them. His mother gives him two binary strings and asks him to convert the binary string str1 into str2 by applying the following rules: Step 1: Reverse any substring of length 2 (of str1 ) and get str1\' ( str1\' != str1 ). Step 2: Reverse any substring of length 3 (of str1 ) and get str1\'\' ( str1\'\' != str1\' ). Step 3: Reverse any substring of length 4 (of str1 ) and get str1\'\'\' ( str1\'\'\' != str1\'\' ). St