551 (1) 썸네일형 리스트형 [Leetcode/C++] 551. Student Attendance Record I class Solution { public: bool checkRecord(string s) { return s.find("LLL") != string::npos || count(s.begin(), s.end(), 'A') > 1 ? false : true; } }; string에 내장되어있는 find 함수를 이용해 LLL을 찾았거나 결석(A) 가 2번이상이면 false를 리턴하도록 구현하였다. stiring의 find 함수는 algorithm의 find 함수와 다르게 find(찾을문자, 시작점)을 주어준다. 문제: https://leetcode.com/problems/student-attendance-record-i/ Student Attendance Record I - LeetCode Level up.. 이전 1 다음