Answer: First, suppose that A is a knight. then when he says "i am a knave" he would be lying, so you have a logical failure because knights can't lie.
if A is a knave and says "I am a Knave, but B isn’t" then he would be telling a truth in the first part.
now you have two paths to tink itm as A said a truth, he can't be a knave. but if you consider the whole sentence can be splitted in two sentences.
I am a Knave ----- wealready know that will be a truth.
but B isn’t----- and now, as the first sentence is true, this must be false, so the sum of both sentences is false.
so A is a knave and B is a knave.