0
Someone help me to implementing my code from java to c++
1 ответ
0
- you cant have method outside class, so add majorityElement3() to Solution class,
- you need main() method for test it
...
return count;
}
//}
public int majorityElement3(int[] nums) {
...
}
public static void main(String[] args) {
int[] a = {5,7,4,6,9,2,1,8,10,3};
var sol = new Solution();
System.out.println(sol.majorityElement( a) );
System.out.println(sol.majorityElement3(a) );
}
}