Quick Sum TopCoder (Brute Force solution)
public static int minSums(String numbers, int sum) {
  int N = numbers.length();  



variables should be named using camelCase casing so n would be better, but what does N/n represent ? Its the number of digits contained in the String numbers which isn't named correctly because there is only one number passed which consists of multiple digits. So a better way would be like so  

public static int minSums(String number, int sum) {
  int digits = number.length();   


but as the default indentation is 4 spaces this should be like so  

public static int minSums(String number, int sum) {
    int digits = number.length();  




This if..else if..else construct can be simplified because for the first cases you are returning a value the else if..else aren't needed and will save some horizontal spacing if removed. You should have the two cases where you check for N == 2 into one single if with a nested if..else like so  

// changed N to digits

if (digits &lt;= 3 &amp;&amp; sum == Integer.parseInt(numbers)) {
    return 0;
}

if (digits == 2) {
    if (Integer.parseInt(numbers.substring(0, N - 1))
       + Integer.parseInt(numbers.substring(N - 1)) == sum) {
        return 1;      
    } else {
        return -1;      
    }
}

if (digits == 1 &amp;&amp; Integer.parseInt(numbers) != sum) {
  return -1;
}

// solution




Commented out code is dead code and should be removed because it is only adding noise to the code which decreases readability.  



Let your variables and operators have some space to breathe. Something like int offset = len-N+k; isn't just as readable as int offset = len -N + k;.