We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Between Two Sets
Between Two Sets
Sort by
recency
|
3032 Discussions
|
Please Login in order to post a comment
my simple javascript code, dont be overengineering
Javascript Code:
JAVA8 CODE public static int gcd(int x, int y){ if(y==0) return x; return gcd(y, x%y); } public static int lcm(int x, int y){ return x*y/gcd(x,y); }
}
}
For Javascript, this is my solution. I don't think this is optimal solution. Coz it is having O(n^2).