Codility - CountFactors

RESULT

import java.util.*;

class Solution {
    public int solution(int N) {
        int root = (int) Math.sqrt(N);
        int count = 0;
        
        for (int i=1; i<=root; i++) {
            if (N % i == 0) {
                count++;
                if (N / i != i) {
                    count++;
                }
            }
        }
        
        return count;
    }
}