package leetcode;

import java.util.ArrayList;
import java.util.List;

/**
 * https://leetcode.com/problems/lexicographical-numbers/
 */
public class Problem386 {
    public List<Integer> lexicalOrder(int n) {
        List<Integer> result = new ArrayList<>();
        // TODO
        return result;
    }

    public static void main(String[] args) {
        Problem386 prob = new Problem386();
        System.out.println(prob.lexicalOrder(13));
    }
}

@@ -40,16 +40,46 @@
 ayList;%0A
+import java.util.Collections;%0A
 import j
@@ -93,16 +93,16 @@
 l.List;%0A
-
 %0A/**%0A * 
@@ -295,15 +295,157 @@
     
-// TODO
+for (int i = 1; i %3C= n; i++) %7B%0A            result.add(i);%0A        %7D%0A        Collections.sort(result, (x, y) -%3E x.toString().compareTo(y.toString()));
 %0A   
@@ -556,24 +556,24 @@
 oblem386();%0A
-
         Syst
@@ -607,20 +607,76 @@
 Order(13));%0A
+        System.out.println(prob.lexicalOrder(5000000));%0A
     %7D%0A%7D%0A

Update problem 386