Блог пользователя dreamkiller

Автор dreamkiller, история, 2 года назад, По-английски

Description

Problem Statement You have to find the perfect number. Given that it is a positive , with no leading zeros and has exactly x digits in it. Suppose this integer is y if you move the last digit to the front then that integer will be z times of y. So, given integers, x and z find that perfect integer. The perfect integer should be minimum possible value. If an integer that meets this condition is not possible, return '-1'.

Constraints 1<=x<=3*10^4 1<=z<=9

Sample input 6 5

Sample output 142857

Please share your approach for this https://leetcode.com/discuss/interview-question/2108673/Finding-the-perfect-number

  • Проголосовать: нравится
  • -20
  • Проголосовать: не нравится

»
2 года назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится
Hint1
Hint2
Hint3