사랑하애오

솔루션

const solution = (str1, str2) => {
  const answer = str1.includes(str2) ? 1 : 2;
  console.log(answer);

  return answer;
};

 

 

 

솔루션

const solution2 = (str1, str2) => {
  const answer = str1.split(str2).length > 1 ? 1 : 2;
  console.log(answer);

  return answer;
};
profile

사랑하애오

@사랑하애

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!