Roblox Interview Question

2D matrix traversal. How many paris equal x after adding and removing digits