solve diff and map