-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMaths.java
More file actions
25 lines (20 loc) · 717 Bytes
/
Copy pathMaths.java
File metadata and controls
25 lines (20 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
public class Maths {
public static void repeatingString(String s, int count) {
// int i=0,j=0,k=0;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
String input = "ABCD";
StringBuilder builder = new StringBuilder(input);
String reverse = builder.reverse().toString();
String pattern = input + reverse.substring(1);
int repeatCount = 10;
StringBuilder resultBuilder = new StringBuilder();
resultBuilder.append(pattern);
for (int i = 0; i < repeatCount; i++) {
resultBuilder.append(pattern.substring(1));
}
String output = resultBuilder.toString();
System.out.println(output);
}
}