Refactor this code to reduce complexity.
Input: if ( words.length == 0 ) { 
  return -1; 
} 
if ( words.length == 1 ) { 
  return 0; 
}
if ( words.length == 0 || words.length == 1 ) {
  return words.length;
}
return -1;
// end of output
if (words.length == 1) { 
  return 0; 
}
if (words.length == 0) { 
  return -1; 
}