massive overhaul :)
add two solutions with different O-complexity for grph problem