https://school.programmers.co.kr/learn/courses/30/lessons/120922
규칙을 생각해 보았다. 가로의 길이 x 세로의 길이 - 1이 규칙이였다.
#include <string>
#include <vector>
using namespace std;
int solution(int M, int N) {
int answer = 0;
answer = M * N - 1;
return answer;
}
#include <string>
#include <vector>
using namespace std;
int solution(int M, int N) {
return M*N-1;
}
그냥 바로 return 해주었다.