If ans is INF : There is no even length path from source to destination else path exists and we print the shortest distance
if ( ans == INF ) System . out . println ( " - 1" ) ; else System . out . println ( ans ) ; } }