Constructing adjacency matrix causes Time Limit Exceeded(Swift)


  • 0
    L

    Any Solution for help?

    for i in 0..<s.count-1 {
                for j in i+1..<s.count {
                    if(connected(s1: s[i], s2: s[j])){
                        record[j].append(i);
                        record[i].append(j);
                    }
                }
            }
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.