Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions solution/0500-0599/0504.Base 7/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,25 @@ impl Solution {

<!-- tabs:end -->

### Solution 2: Concise Implementation (Integer.toString)

We can directly use Java’s built-in base conversion method.
Time complexity: $O(\log_7 n)$, space complexity: $O(1)$.

<!-- tabs:start -->

#### Java

```java
class Solution {
public String convertToBase7(int num) {
return Integer.toString(num, 7);
}
}
```

<!-- tabs:end -->

<!-- solution:end -->

<!-- problem:end -->