diff --git a/solution/0500-0599/0504.Base 7/README_EN.md b/solution/0500-0599/0504.Base 7/README_EN.md index 20c58cdef8dff..acd1583602420 100644 --- a/solution/0500-0599/0504.Base 7/README_EN.md +++ b/solution/0500-0599/0504.Base 7/README_EN.md @@ -166,6 +166,25 @@ impl Solution { +### 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)$. + + + +#### Java + +```java +class Solution { + public String convertToBase7(int num) { + return Integer.toString(num, 7); + } +} +``` + + +