Why not working?


#1

Comment body goes int getcount(ListNode* A)
{
ListNode* temp;
temp = A;
int count = 0;
while(temp->next != NULL)
{
count++;
temp = temp->next;
}
return count;
}
ListNode* Solution::getIntersectionNode(ListNode* A, ListNode* B)
{

int m = getcount(A);
int n = getcount(B);
for(int i=0;i<n;i++)
{
    for(int j=i;j<m;j++)
    {
        if(A->next == B->next)
        {
            return A->next;
        }
    }
}

} here.


#2

The class provided
has no count method