Skip to content

Commit 1506fb4

Browse files
populating the BaseSeven.dart file
1 parent 9a01bcc commit 1506fb4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

BaseSeven.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Leetcode Problem No. 504 : Given an integer num, return a string of its base 7 representation.
2+
// Leetcode Problem Link: https://leetcode.com/problems/base-7/
3+
// Result using Dart language here: Runtime: 485 ms, Memory Usage: 140.5 MB
4+
5+
// Solution:
6+
7+
// toRadixString is part of dart:core library
8+
class Solution {
9+
String convertToBase7(int num) {
10+
return num.toRadixString(7);
11+
}
12+
}

0 commit comments

Comments
 (0)