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
  • Hiring developers?
  1. All Contests
  2. ProjectEuler+
  3. Project Euler #5: Smallest multiple
  4. Discussions

Project Euler #5: Smallest multiple

Problem
Submissions
Leaderboard
Discussions

    You are viewing a single comment's thread. Return to all comments →

  • xpresskaran98
    4 months ago+ 0 comments

    python 3

    t = int(input().strip())
    for a0 in range(t):
        n = int(input().strip())
        num = 0
        while True:
            num += 1
            isOutput = True
            for i in range(1, n + 1):
                if num % i != 0:
                    isOutput = False
                    break
            if isOutput:
                break
        print(num)
    
    0|
    Permalink
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy