/*
 * Copyright (C) 2014 Pedro Vicente Gómez Sánchez.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.github.pedrovgs.app.problem11;

/**
 * Given a integer, can you write a method to transform a given integer to String? Take into
 * account
 * you can receive negative integers.
 *
 * @author Pedro Vicente Gómez Sánchez.
 */
public class IntToString {

  public String transform(int number) {
    return null;
  }

}

@@ -876,66 +876,808 @@
 %0A%0A  
-public String transform(int number) %7B%0A    return null
+/**%0A   * Algorithm implementation based on the module of a given number and iterate until the number is%0A   * zero. With this approach we get a complexity order equals to O(N) in time terms where N is the%0A   * number of digits in the given integer. In space terms, the complexity order is also O(N)%0A   * because we are using an StringBuilder as auxiliary data structure.%0A   */%0A  public String transform(int number) %7B%0A    boolean isNegative = false;%0A    StringBuilder sb = new StringBuilder();%0A    if (number == 0) %7B%0A      return %220%22;%0A    %7D else if (number %3C 0) %7B%0A      isNegative = true
 ;%0A  
+ 
+ 
 %7D%0A
+    number = Math.abs(number);%0A%0A    while (number %3E 0) %7B%0A      sb.append(number %25 10);%0A      number /= 10;%0A    %7D%0A    %0A    if (isNegative) %7B%0A      sb.append(%22-%22);%0A    %7D%0A%0A    return sb.reverse().toString();%0A  %7D
 %0A%7D%0A

Add implementation to problem 11