fork download
  1. class Solution {
  2. public int minMergedInteger(int[] nums) {
  3. int res = Integer.MAX_VALUE;
  4. int n = nums.length;
  5. List<Integer>nums2 = new ArrayList<>();
  6.  
  7. for(int i=0;i<n-1;i+=2){
  8. int a=nums[i];
  9. int b=nums[i+1];
  10. String aa =String.valueOf(a);
  11. String bb =String.valueOf(b);
  12. String cc = aa+bb;
  13. int ccc=Integer.valueOf(cc);
  14.  
  15. nums2.add(ccc);
  16. }
  17.  
  18. for(int i=0;i<nums2.size();i++){
  19. if(nums2.get(i) < res){
  20. res=nums2.get(i);
  21. }
  22. }
  23. return res;
  24. }
  25. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:5: error: cannot find symbol
        List<Integer>nums2 = new ArrayList<>();
        ^
  symbol:   class List
  location: class Solution
Main.java:5: error: cannot find symbol
        List<Integer>nums2 = new ArrayList<>();
                                 ^
  symbol:   class ArrayList
  location: class Solution
2 errors
stdout
Standard output is empty