我的代码找不到了。字符串中的子字符串。为什么 j<=str.length() - 3 导致运行时错误?

My code to find no. of a substrings in a string. Why is j<=str.length() - 3 causing runtime error?

    #include <iostream>
    #include <string>
    using namespace std;
    
    int main() {
        
        int T;
        int count = 0;                                      
        cin>>T;
        
        for(int i = 0; i<T; i++) 
        {
            
            string str;
            cin>>str;
            count = 0;

字符串长度使用无符号数学; 2-3 变成 2^64-1。尝试 j<-3 || j+3<=str.length()