There is an algorithmic way to solve this which works when you have two types of squares.
if $\displaystyle \text{gcd}(a,b) = 1$, then for any integer $c$ the linear diophantine equation $\displaystyle ax + by = c$ has an infinite number of solution, with integer $\displaystyle x,y$.
In fact if $\displaystyle x_0, y_0$ are such that $\displaystyle a x_0 - b y_0 = 1$, then all the solutions of $\displaystyle ax + by = c$ are given by
$\displaystyle x = -tb + cx_0$, $\displaystyle y = ta - cy_0$, where $\displaystyle t$ is an arbitrary integer.
$\displaystyle x_0 , y_0$ can be found using the Extended Euclidean Algorithm.
Since you also need $\displaystyle x \ge 0$ and $\displaystyle y \ge 0$ you must pick a $\displaystyle t$ such that
$\displaystyle c x_0 \ge tb$ and $ta \ge cy_0$.
If there is no such $\displaystyle t$, then you do not have a solution.
In your case, $\displaystyle a= 9, b= 4$, we need a solution of $\displaystyle ax + by = 35$.
We can easily see that $\displaystyle x_0 = 1, y_0 = 2$ gives us $\displaystyle a x_0 - by_0 = 1$.
Thus we need to find a $\displaystyle t$ such that $ 35 \ge t\times 4$ and $ t\times 9 \ge 35\times 2$.
i.e.
$\displaystyle 35/4 \ge t \ge 35\times 2/9$
i.e.
$\displaystyle 8.75 \ge t \ge 7.77\dots$
Thus $t = 8$.
This gives us $\displaystyle x = cx_0 - tb = 3$, $\displaystyle y = ta- cy_0 = 2$.
(Note: I have swapped your x and y).