Hello,
I have two strings of letters (columns String A and String B) and I want to transform them into strings like the ones in Solution 1 and Solution 2 correspondingly.
In the case of String A, I need to remove any adjacent duplicate numbers (the numbers are separated by a "-"), so the string 6-8-8-13-13-11-10-14-14-7-4-7-2-1-0-3-9 would turn into 6-8-13-11-10-14-7-4-7-2-1-0-3-9.
String B is a little bit more complicated: both String A and String B have the same amount of items, and I want to transform String 2 depending on the transformation of String 1 into Solution 1. For example, in my data, I have 6-8-8-13-13-11-10-14-14-7-4-7-2-1-0-3-9 as String 1 and DDDDDDDDDDDDDDDDT as String 2. Solution 1 would be 6-8-13-11-10-14-7-4-7-2-1-0-3-9 (remove adjacent duplicate numbers) and Solution 2 would be DDDDDDDDDDDDDT (remove characters that are in the same position as the numbers removed from String 1).
I hope this makes sense and I'm happy to provide any further clarification.
Best,
alecambo
I have two strings of letters (columns String A and String B) and I want to transform them into strings like the ones in Solution 1 and Solution 2 correspondingly.
String A | String B | Solution A | Solution B | ||
7-6-1-3-4-2-2 | DDDDDTT |
| DDDDDT | ||
|
| 3-0-2-0 | DTDT | ||
6-8-8-13-13-11-10-14-14-7-4-7-2-1-0-3-9 | DDDDDDDDDDDDDDDDT | 6-8-13-11-10-14-7-4-7-2-1-0-3-9 | DDDDDDDDDDDDDT |
In the case of String A, I need to remove any adjacent duplicate numbers (the numbers are separated by a "-"), so the string 6-8-8-13-13-11-10-14-14-7-4-7-2-1-0-3-9 would turn into 6-8-13-11-10-14-7-4-7-2-1-0-3-9.
String B is a little bit more complicated: both String A and String B have the same amount of items, and I want to transform String 2 depending on the transformation of String 1 into Solution 1. For example, in my data, I have 6-8-8-13-13-11-10-14-14-7-4-7-2-1-0-3-9 as String 1 and DDDDDDDDDDDDDDDDT as String 2. Solution 1 would be 6-8-13-11-10-14-7-4-7-2-1-0-3-9 (remove adjacent duplicate numbers) and Solution 2 would be DDDDDDDDDDDDDT (remove characters that are in the same position as the numbers removed from String 1).
I hope this makes sense and I'm happy to provide any further clarification.
Best,
alecambo