강의

멘토링

커뮤니티

Inflearn Community Q&A

eagle11292602's profile image
eagle11292602

asked

Introduction to Algorithm Problem Solving for IT Employment (with C/C++): Coding Test Preparation

16. Anagram (Google Interview Question)

궁금한게 있습니다!

Resolved

Written on

·

182

0

코드중 마지막 부분에서

for(i=1; i<=52; i++){

if(a[i]==b[i]){

printf("YES\n");

exit(0);

}

}

printf("NO\n");

return 0;

}

이런식으로 변경하면 안되는 이유가 무엇인지 궁금합니다

C++코테 준비 같이 해요!

Answer 2

1

codingcamp님의 프로필 이미지
codingcamp
Instructor

안녕하세요^^

단어를 구성하는 모든 알파벳이 다 같은지 확인하지 않고 첫번째로 같은 개수의 알파벳이 나오면 다른 알파벳은 확인하지 않고 바로 YES 출력하고 끝나버리는 코드입니다. 

0

eagle1129님의 프로필 이미지
eagle1129
Questioner

이해했습니다 감사합니다

eagle11292602's profile image
eagle11292602

asked

Ask a question