Minimum steps to reach target (1 or 2)
Java
Hard
5 views
Problem Description
Task: you can add 1 or 2 each move. Return minimum moves to reach exactly n.
Output Format
Return value
Official Solution
static int minMoves12(int n){return n/2 + (n%2);}
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!