숫자 게임

숫자 게임

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

import java.util. * ; class Solution { public int solution( int [] A, int [] B) { int answer = 0 ; int pos = 0 ; Arrays.sort(A); Arrays.sort(B); for ( int i = 0 ;i < A.length;i + + ) { for ( int j = pos;j < B.length;j + + ) { if (A[i] < B[j]) { answer + + ; pos = j + 1 ; break ; } } } return answer; } } Colored by Color Scripter

from http://zzunsik.tistory.com/216 by ccl(A) rewrite - 2021-11-03 11:02:05