프로그래머스 12924번
https://school.programmers.co.kr/learn/courses/30/lessons/12924

        int n = 3;
        int ans = 0;
        for (int i = 1; i <= n; i += 2) {
            if (n % i == 0) {
                System.out.println(" i : " + i);
                ans++;
            }
        }
더 간단한 풀이
정수론으로 풀이가능하다.

import java.util.*;
class Solution {
    public int solution(int n) {
        int answer = 0;
        
        return twoPointer(n);
    } // End of solution()
    
    public int twoPointer(int n) {
        int count = 0;
        int low = 1;
        int high = 1;
        while(low <= n) {            
            int sum = 0;
            for(int i=low; i<high; i++) {
                sum += i;
            }
            
            if(sum == n) {
                count++;
                low++;
            } else if(sum > n) {
                low++;
            } else if(sum < n) {
                high++;
            }   
        }
        return count;
    } // End of twoPointer()
} // End of Solution class