Help us understand the problem. What is going on with this article?

Project Euler 52「置換倍数」

More than 1 year has passed since last update.

たまには「これは問の性質上n桁~m桁の範囲のみチェックすればよい(キリッ」とか言いたいけど思いつかないので右ストレートでぶっ飛ばす、まっすぐ行ってぶっ飛ばす。

Problem 52 「置換倍数」

125874を2倍すると251748となる. これは元の数125874と順番は違うが同じ数を含む.
2x, 3x, 4x, 5x, 6x が x と同じ数を含むような最小の正整数 x を求めよ.

def hoge(num):
    f = lambda n: sorted(str(n))
    n = 1
    while not all( f(n) == f(n*i) for i in range(2, num+1) ):
        n += 1
    return n

print(hoge(6))
Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away