0

Input: a=2 b=3 N=10

The numbers which are divisible by 2 or 3 are: 2,3,4,6,8,9,10,12,14,15 and the 10th number is 15.

  • 1
    I don't suppose there is a simple closed formula for this. It's easy enough to search though...for any bound $M$ list all the multiples of $a,b$ which are $≤M$ and then sort. – lulu Sep 09 '17 at 17:38

1 Answers1

2

This question is regarding an online coding competition. Any one who wants to answer this please wait till 1:00 AM, 11 September, 2017 Indian Standard Time.

Link : https://www.hackerearth.com/challenge/hiring/amazon-developer-hiring-challenge

Sameer
  • 21