classSolution{public:intminNumber(vector<int>&nums1,vector<int>&nums2){intans=89;// the largest num we can havefor(constinta:nums1)for(constintb:nums2)ans=min(ans,a==b?a:min(a,b)*10+max(a,b));returnans;}};
123456789
classSolution{publicintminNumber(int[]nums1,int[]nums2){intans=89;// the largest num we can havefor(finalinta:nums1)for(finalintb:nums2)ans=Math.min(ans,a==b?a:Math.min(a,b)*10+Math.max(a,b));returnans;}}