Education + Jobs Hiring Website - 2025
0 like 0 dislike
1,497 views
in Online Assessments by Expert (145,220 points) | 1,497 views

1 Answer

0 like 0 dislike
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
by Expert (145,220 points)

Get best answers to any doubt/query/question related to programming , jobs, gate, internships and tech-companies. Feel free to ask a question and you will receive the best advice/suggestion related to anything you ask about software-engineering , development and programming problems .