-
Notifications
You must be signed in to change notification settings - Fork 30
Closed
Description
Good morning! Here's your coding interview problem for today.
This problem was asked by PagerDuty.
Given a positive integer N, find the smallest number of steps it will take to reach 1.
There are two kinds of permitted steps:
- You may decrement
NtoN - 1. - If
a * b = N, you may decrementNto the larger ofaandb.
For example, given100, you can reach1in five steps with the following route:100 -> 10 -> 9 -> 3 -> 2 -> 1.
Metadata
Metadata
Assignees
Labels
No labels