diff --git a/day49/Accumul.java b/day49/Accumul.java new file mode 100644 index 0000000..6230a2e --- /dev/null +++ b/day49/Accumul.java @@ -0,0 +1,17 @@ +public class Accumul { + + public static String accum(String s) { + StringBuilder newString = new StringBuilder(); + for (int i = 0; i < s.length(); i++) { + char currentChar = s.charAt(i); + newString.append(Character.toUpperCase(currentChar)); + for (int j = 0; j < i; j++) { + newString.append(Character.toLowerCase(currentChar)); + } + if (i != s.length() - 1) { + newString.append("-"); + } + } + return newString.toString(); + } +} \ No newline at end of file diff --git a/day49/README.md b/day49/README.md new file mode 100644 index 0000000..d368922 --- /dev/null +++ b/day49/README.md @@ -0,0 +1,13 @@ +Question of the day: Accumul Kata +http://www.codewars.com/kata/5667e8f4e3f572a8f2000039/solutions/java/all/clever + +## Ideas + +Just do it + +## Code + +[Java](./day49) + +## Follow up +