โ† HSBC questions
CodingReported in a candidate post, Jan 2023

Reduce N to one

Filed under HSBC

Given an integer N, find the minimum number of operations to reduce N to 1. Allowed operations are: replacing N with N/x where x < N and N % x == 0, or replacing N with N - 1.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related HSBC questions

Collected from public candidate posts and coding forums. Updated Nov 2026.