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.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Apply
  • Hiring developers?
  1. All Contests
  2. ProjectEuler+
  3. Project Euler #5: Smallest multiple
  4. Discussions

Project Euler #5: Smallest multiple

Contest ends in
Problem
Submissions
Leaderboard
Discussions

Sort 243 Discussions, By:

recency

Please Login in order to post a comment

  • ramiamar698
    3 weeks ago+ 0 comments

    hey can someone help me out with this problem? im new to competitive programming and my friend sent me this. he wants me to solve it but as i said, im still new so can yall teach me? here is the problem https://www.hackerrank.com/newbie-challenge

    0|
    Permalink
  • singhjaitawat824
    1 month ago+ 0 comments

    import sys import math

    t = int(input().strip()) for a0 in range(t): n = int(input().strip())

    arr = []
    
    for item in range(1,n+1): 
        arr.append(item)
    
    print(math.lcm(*arr))
    
    0|
    Permalink
  • ramiamar698
    1 month ago+ 0 comments

    hey can someone help me out with this problem? im new to competitive programming and my friend sent me this. he wants me to solve it but as i said, im still new so can yall teach me? here is the problem https://www.hackerrank.com/newbie-challenge

    0|
    Permalink
  • atulyadav22000
    2 months ago+ 0 comments

    public static void main(String[] args) { Scanner in = new Scanner(System.in); int t = in.nextInt(); for(int a0 = 0; a0 < t; a0++){ int n = in.nextInt(); System.out.println(lcm(n));

    }
    }
    public static int lcm(int n){
        int result=1;
        for(int i=2;i<=n;i++){
            result=result*i/gcd(result,i);
        }
        return result;
    
    }
    public static int gcd(int n,int o){
        if(o==0)
            return n;
    
       return gcd(o,n%o);
    }
    
    0|
    Permalink
  • ayush013pps
    2 months ago+ 0 comments

    import sys

    import math

    for _ in range(int(input())): x = int(input()) result = 1 for i in range(1, x + 1): result = result * i // math.gcd(result, i) print(result)

    0|
    Permalink
Load more conversations

Need Help?


View top submissions
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy