Function to return lcm of two numbers
function lcm ( a , b ) { return ( a * b ) / ( __gcd ( a , b ) ) ; } function __gcd ( a , b ) { return b == 0 ? a : __gcd ( b , a % b ) ; } function dfs ( src , adj , visited ) { visited [ src ] = true ; let count = 1 ; for ( let i = 0 ; i < adj [ src ] . length ; i ++ ) if ( ! visited [ adj [ src ] [ i ] ] ) count += dfs ( adj [ src ] [ i ] , adj , visited ) ; return count ; } function findMinTime ( arr , P , n ) {