> For the complete documentation index, see [llms.txt](https://jaywin.gitbook.io/leetcode/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jaywin.gitbook.io/leetcode/solutions/1256-encode-number.md).

# 1256. Encode Number

<https://leetcode.com/problems/encode-number>

## Description

Given a non-negative integer `num`, Return its *encoding* string.

The encoding is done by converting the integer to a string using a secret function that you should deduce from the following table:

![](https://assets.leetcode.com/uploads/2019/06/21/encode_number.png)

**Example 1:**

```

**Input:** num = 23
**Output:** "1000"
```

**Example 2:**

```

**Input:** num = 107
**Output:** "101100"
```

**Constraints:**

* `0 <= num <= 10^9`

## ac

```java
```
