Take the maximum count of prime in a number
else { for ( Map . Entry < Long , Long > x : single_number . entrySet ( ) ) prime_factor . put ( x . getKey ( ) , Math . max ( x . getValue ( ) , ( prime_factor . get ( x . getKey ( ) ) == null ? 0 : prime_factor . get ( x . getKey ( ) ) ) ) ) ; } } long ans = 0 , lcm = 1 ;