Java -- ++ in if statement

I am confused about the difference between this 3 statement. What differences between each of them? I know the differences between first and third, but how different is between first and second, and second to third. Thank!

    // first
    for (int i = 0, j = 0; i < s.length(); i++) {
        if (count[s.charAt(i)]-- > 0) {
            tLen--;
        }
    }

    // second
    for (int i = 0, j = 0; i < s.length(); i++) {
        count[s.charAt(i)]--;
        if (count[s.charAt(i)] > 0) {
            tLen--;
        }
    }
    

    // third
    for (int i = 0, j = 0; i < s.length(); i++) {
        
        if (count[s.charAt(i)] > 0) {
            count[s.charAt(i)]--;
            tLen--;
        }
    }


from Recent Questions - Stack Overflow https://ift.tt/39iDc9o
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Spring Elasticsearch Operations

Network Error and Timeout on Authorize.net JS

Object oriented programming concepts (OOPs)