आज्ञा देना सकारात्मक पूर्णांक है जिसमें दशमलव अंक । चलो एक अन्य पूर्णांक सकारात्मक हो।
इस चुनौती के प्रयोजन के लिए, हम कहते हैं एक नकल की अगर वहाँ धनात्मक पूर्णांक कम से कम एक सूची मौजूद है ऐसी है कि:
and are called reciprocal copycats if is a copycat of and is a copycat of .
Example
and are reciprocal copycats because:
and:
The challenge
Given two positive integers and , your task is to print or return a truthy value if and are reciprocal copycats or a falsy value otherwise.
Clarifications and rules
- You may take and in any reasonable, unambiguous format (e.g. integers, strings, lists of digits, ...)
- and may be equal. If a number is a reciprocal copycat of itself, it belongs to A007532.
- Instead of truthy/falsy values, you may return two distinct consistent values.
- For and , your code must complete in less than one minute. If it's taking too much time for higher values, it must however be able to solve them in theory.
- This is code-golf.
Test cases
Truthy:
1 1
12 33
22 64
8 512
23 737
89 89
222 592
526 853
946 961
7 2401
24 4224
3263 9734
86 79424
68995 59227
32028 695345
Falsy:
1 2
3 27
9 24
24 42
33 715
33 732
222 542
935 994
17 2401
8245 4153
17 2401 -> false
. I'm almost tripped on this.