Problem Statement  
You will be given a list of line segments in an infinite xy plane. Your method should return how many separate regions there are in the plane once the segments are added. Two points are in the same region if there exists a path from one point to the other that doesn't cross a line segment. The line segments will be given in a String[] lines. Each element of lines will be a single space delimited list of 4 integers. The elements will be formatted as (quotes for clarity) "x0 y0 x1 y1" denoting a line segment from (x0,y0) to (x1,y1). Note that there will always be exactly 1 infinite region that is not completely enclosed by the given line segments. In addition, to make things easier, the line segments will only be horizontal, vertical or diagonal (a diagonal line segment is one whose slope is 1 or 1).  
Definition  
 
Notes  
  Although the line segment endpoints are bounded by input constraints, when calculating regions, consider the plane to be infinite.  
Constraints  
  lines will contain between 1 and 50 elements, inclusive.  
  Each element of lines will contain between 7 and 15 characters, inclusive.  
  Each element of lines will be formatted as "N N N N" where each N represents an integer between 0 and 100 inclusive with no extra leading zeros, and each N is separated by a single space.  
  No line segment will have 0 length.  
  Each line segment will be horizontal, vertical, or diagonal.  
  No two elements of lines will represent the same line segment. This includes cases where one segment goes from point A to point B, and another goes from B to A.  
Examples  
0)  
 
1)  
 
2)  
 
3)  
 
4)  
