Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
boot up

Chinsyo chinsyo

👨‍💻
boot up
View GitHub Profile
View Leetcode 504 | base 7
class Solution {
func convertToBase7(_ num: Int) -> String {
let flag = num < 0
var src = abs(num)
var ret = String()
repeat {
ret = "\(src % 7)" + ret
src /= 7
You can’t perform that action at this time.