rowCount and columnCount, to store the count of black pixels in each row and column respectively.(i, j), increment rowCount[i] and columnCount[j] by 1.answer to store the count of lonely black pixels.(i, j), if rowCount[i] and columnCount[j] are both equal to 1, increment answer by 1.answer.