@@ -0,0 +1,684 @@
+package com.ttaylorr.ctci.answers.chapter_1;%0A%0Aimport com.ttaylorr.ctci.meta.Solution;%0A%0A@Solution(chapter = 1, problem = 2)%0Apublic class StringReverser %7B%0A    protected final String str;%0A%0A    public StringReverser(String str) %7B%0A        this.str = str;%0A    %7D%0A%0A    public String reverse() %7B%0A        char%5B%5D chars = this.str.toCharArray();%0A        // Since this is a %22C-style%22 string, it has a null-terminator, which isn't counted here%0A        int length = chars.length - 1;%0A%0A        for (int i = 0; i %3C length / 2; i++) %7B%0A            char temp = chars%5Bi%5D;%0A            chars%5Bi%5D = chars%5Blength - i%5D;%0A            chars%5Blength - i%5D = temp;%0A        %7D%0A%0A        return new String(chars);%0A    %7D%0A%7D%0A

Implement chapter 1, problem 2