题解 | 机器人走方格I
机器人走方格I
https://www.nowcoder.com/practice/e8bb8e68434e42acbcdff0341f2a32c5
#include <vector>
class Robot {
public:
int countWays(int x, int y) {
// write code here
if(x==1 || y==1 ) return 1;
if(x==2 && y == 2) return 2;
return countWays(x-1, y) + countWays(x, y-1);
}
};

