---
title: "Discussion on \"LeetCode Challenge #2: Number of Steps to Reduce a Number to Zero\" | Hashnode"
description: "Discussion on \"LeetCode Challenge #2: Number of Steps to Reduce a Number to Zero\". Problem statement:\nGiven a non-negative integer num, return the number of steps to reduce it to zero. If the current number is even, you have to divide it by 2, otherwise, you have to subtract 1 from it.\nExample 1:\nInput: num = 14\nOutput: 6\nExplanati..."
url: "https://hashnode.com/posts/leetcode-challenge-2-number-of-steps-to-reduce-a-number-to-zero/5ec55676c3a6003a777e3a1f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [LeetCode Challenge #2: Number of Steps to Reduce a Number to Zero](https://blog.lo-victoria.com/leetcode-challenge-2-number-of-steps-to-reduce-a-number-to-zero?utm_source=hashnode&utm_medium=feed)

Problem statement: Given a non-negative integer num, return the number of steps to reduce it to zero. If the current number is even, you have to divide it by 2, otherwise, you have to subtract 1 from it. Example 1: Input: num = 14 Output: 6 Explanati...

May 21, 2020 · blog.lo-victoria.com  
Read the article

-   [#challenge](https://hashnode.com/tag/challenge)
-   [#java](https://hashnode.com/tag/java)
-   [#leetcode](https://hashnode.com/tag/leetcode)

## Written by

[Victoria Lo](https://hashnode.com/@victoria)

@victoria · Singapore

  
[View profile](https://hashnode.com/@victoria)

A nerd in books, tea, games and software.

I'm a solutions engineer lead, GitHub Star, Director of WomenDevsSG, and co founder of ragTech. I work at the intersection of tech, systems, and leadership, and this blog is where I share my journey through all three. Expect honest reflections, real experiences, and thoughts that are still forming rather than polished career advice.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
