Skip to content

Commit 39421b1

Browse files
committed
feat: Mirror a string by concatenating it with itself for multiple test cases
🧠 Logic: - Read the number of test cases `t`. - For each test case: - Read a string `s`. - Create a new string `x` by concatenating `s + s`. - Print `x`. 📌 Purpose: Demonstrates string manipulation using concatenation in Java and looping through multiple inputs efficiently. Signed-off-by: Somesh diwan <[email protected]>
1 parent 068e82a commit 39421b1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Section6StringClassPrinting/src/StringCC2.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
You need to perform the following operation
88
Create a variable X which contains the string S concatenated with the string S
99
Output X for each test case
10-
1110
*/
1211

1312
import java.util.Scanner;
@@ -25,8 +24,7 @@ public static void main(String[] args) {
2524
// create a variable X which stores the value of string S concatenated with itself
2625
String x = s + s;
2726

28-
// output the variable X
2927
System.out.println(x);
3028
}
3129
}
32-
}
30+
}

0 commit comments

Comments
 (0)