Competitive Programming Solutions

GitHub
back to dashboard

D. Strings

Codeforces - Sheet #4 (Strings) · limit: 2s · memory: 64MB · view on codeforces

input

abcd
ef

output

4 2
abcdef
ebcd af
Main.java
static void solve() {

        // Write your solution here
        String a = in.next();
        String b = in.next();
        out.println(a.length() + " " + b.length());
        out.println(a + b);
        out.println(b.charAt(0) + a.substring(1) + " " + a.charAt(0) + b.substring(1));
    }