I've got two lists of words. I want to check if the first word from listA is in listB, then second word from listA is in listB, and so on. If a word is present, I increment some integer variable. I have to do it with recursive function isWordInArray which takes 2 arguments: listA and listB
I've tried to do something like this,but I have no idea if it's correct :
isWordInArray(listA, listB) = isWordInArray(listA[i] in listB)
listA=["dog","is","black"] listB=["my","cat","is","white"]output 1 My recursive function should return 1,because only "is" appears in both lists.What I haven't mentioned is that I will remove that word from both lists.