Amazon Interview Question for Software Engineer / Developers
- 1of 1 vote
All jumbled numbers of n digits in max (worst case) O(n) and min (avg case) O(log n) time.- mani0119 October 08, 2017 in India
A number is a jumbled number if the _absolute_ difference between adjacent digits is <=1.
For an input n=3
output should be
and so on.
The problem is similar to the one listed here https://www.careercup.com/question?id=5729332770111488
But this problem also has a O(n or log n) limitation and the solutions listed in the above mentioned problem at the time of posting this question, do not satisfy the criteria
PS: 001 is not a 3 digit number.
210 is absolutely fine as the absolute difference between adjacent digits is <=1.
| Report Duplicate | Flag | PURGE
Amazon Software Engineer / Developer Algorithm
Interview Type: In-Person
Open Chat in New Window