Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
알파벳
(0, 0)
에서 시작하여상, 하, 좌, 우
방향으로 탐색하며 중복되지 않는 알파벳을 최대한으로 탐색하는 문제나는 무엇을 할 수 있게 되었는가?
vector<string> str(개수)
를 통해 string 벡터를 선언하고 입력받을 수 있다.check
배열의 경우 아스키 코드를 이용하면 배열의 사이즈를0 ~ 25
까지로 조정할 수 있다.go
함수로 상하좌우에 더 이상 갈 곳이 없을 때 맨 마지막 재귀는ans + 1
값을 return 할 것이다.ans는 0이었으므로, 1을 return 할 것이고, 맨 마지막 재귀를 호출했던 함수는 next에
1
이 저장된다. 그때의 ans 는 0이었고, next값이 더 크므로 ans는 1이 된다.재귀가 호출되어 돌아오는 값 만큼 증가하게 되고, 최초의 위치인
(0, 0)
에 왔을 때는 최장거리값이 ans에 담겨있을 것이다.