551, Student Attendance Record I

동청·2022년 8월 17일

leetcode

목록 보기
20/39

Problem

leetcode 바로가기

You are given a string s representing an attendance record for a student where each character signifies whether the student was absent, late, or present on that day. The record only contains the following three characters:

  • 'A': Absent.
  • 'L': Late.
  • 'P': Present.

The student is eligible for an attendance award if they meet both of the following criteria:

  • The student was absent ('A') for strictly fewer than 2 days total.
  • The student was never late ('L') for 3 or more consecutive days.

Return true if the student is eligible for an attendance award, or false otherwise.

Example 1:

Input: s = "PPALLP"
Output: true
Explanation: The student has fewer than 2 absences and was never late 3 or more consecutive days.

Example 2:

Input: s = "PPALLL"
Output: false
Explanation: The student was late 3 consecutive days in the last 3 days, so is not eligible for the award.

Constraints:

  • 1 <= s.length <= 1000
  • s[i] is either 'A', 'L', or 'P'.

Solution

/**
 * @param {string} s
 * @return {boolean}
 */
var checkRecord = function(s) {
    if (s.length < 2) {
        return true;
    }
  let num = [0];

  for (let i = 0; i < s.length; i++) {
    if(s[i] == "A") {
      num++;
      if (num == 2) {
        return false;
      }
    } else if (s[i - 2] == "L" && s[i - 1] == "L" && s[i] == "L") {
      return false;
    }
  }

  return true;
};

5개의 댓글

comment-user-thumbnail
2023년 10월 4일

Introducing the all-new Microsoft https://www.dumpsmate.com/MS-102-exam.html Exam Prep [2023] – your key to unlocking career opportunities! Our comprehensive study materials are meticulously designed to align with the latest exam objectives. Prepare with confidence as we cover the freshest set of questions and scenarios, ensuring you're fully equipped to ace the MS-102 Exam. Stay ahead of the curve with our up-to-date content, expertly crafted to enhance your skills in Microsoft 365 Identity and Services. Don't miss out on this opportunity to excel in your career – get started today with the most cutting-edge MS-102 Exam Prep available! Your success is just a click away.

답글 달기
comment-user-thumbnail
2023년 12월 4일

I like being a student, although there are difficult periods in this. Especially when you need to prepare for assignments and exams. This service help with nursing essay. And this always helps me out in difficult moments and helps me prepare properly.

답글 달기
comment-user-thumbnail
2024년 8월 16일

Navigate NURS FPX 4020 Assessments with Confidence: Expert Tutoring Available

Achieve mastery in NURS FPX 4020 assessments with our tailored tutoring services. From Assessment 1 to 4, we ensure a comprehensive learning experience that propels you to success. Transform your nursing education journey today.

Introduction to NURS FPX 4020 Series Assessments

The NURS FPX 4020 series is designed to challenge and expand your nursing expertise, focusing on critical aspects of healthcare delivery and patient care. Starting from NURS FPX 4020 Assessment 1 through to NURS FPX 4020 Assessment 4, each assessment is an opportunity to deepen your understanding and apply theoretical knowledge to practical scenarios.

Expert Tutoring for Unmatched Success

Our online tutoring service is the bridge between your current knowledge and the success you aim to achieve in the NURS FPX 4020 series. We specialize in guiding students through their NURS FPX 4020 Assessment 2 and NURS FPX 4020 Assessment 3, ensuring that they not only understand the material but are also able to apply it effectively.

Personalized Learning Paths

We recognize that personalized attention is key to mastering complex nursing concepts. Our tutoring sessions are customized to fit your learning style and pace, especially when tackling the intricacies of NURS FPX 4020 Assessment 4. Our goal is to make every concept clear, no matter how challenging it may seem.

Access to Nursing Education Experts

Our team consists of nursing educators who are not only experts in their field but also deeply familiar with the NURS FPX 4020 curriculum. Whether you need help with NURS FPX 4020 Assessment 1 or any subsequent assessments, our tutors offer insights and strategies that are directly applicable to your studies.

Streamline Your Success in One Billing Cycle

Completing your nursing program efficiently and successfully is our top priority. With focused support for NURS FPX 4020 Assessment 2 and NURS FPX 4020 Assessment 3, among others, we aim to streamline your study process, enabling you to excel in your assessments and advance in your nursing career more rapidly.

Comprehensive Support for Every Assessment

Our support extends beyond just tutoring sessions. From "Take my assessment" services to "Online assessment help," we provide a full spectrum of resources designed to prepare you thoroughly for NURS FPX 4020 Assessment 4 and all other assessments in the series.

Elevate Your Nursing Career with Us

Embarking on the NURS FPX 4020 series with our expert tutoring services means setting yourself up for success. With personalized support, expert guidance, and comprehensive resources, you're not just preparing for assessments; you're preparing for a thriving career in nursing.

Take the first step towards excellence in your NURS FPX 4020 assessments.

Contact us today and discover how our expert tutoring can transform your nursing education journey.

답글 달기
comment-user-thumbnail
2024년 8월 16일

Navigate NURS FPX 4020 Assessments with Confidence: Expert Tutoring Available

Achieve mastery in NURS FPX 4020 assessments with our tailored tutoring services. From Assessment 1 to 4, we ensure a comprehensive learning experience that propels you to success. Transform your nursing education journey today.

Introduction to NURS FPX 4020 Series Assessments

The NURS FPX 4020 series is designed to challenge and expand your nursing expertise, focusing on critical aspects of healthcare delivery and patient care. Starting from NURS FPX 4020 Assessment 1 through to NURS FPX 4020 Assessment 4, each assessment is an opportunity to deepen your understanding and apply theoretical knowledge to practical scenarios.

Expert Tutoring for Unmatched Success

Our online tutoring service is the bridge between your current knowledge and the success you aim to achieve in the NURS FPX 4020 series. We specialize in guiding students through their NURS FPX 4020 Assessment 2 and NURS FPX 4020 Assessment 3, ensuring that they not only understand the material but are also able to apply it effectively.

Personalized Learning Paths

We recognize that personalized attention is key to mastering complex nursing concepts. Our tutoring sessions are customized to fit your learning style and pace, especially when tackling the intricacies of NURS FPX 4020 Assessment 4. Our goal is to make every concept clear, no matter how challenging it may seem.

Access to Nursing Education Experts

Our team consists of nursing educators who are not only experts in their field but also deeply familiar with the NURS FPX 4020 curriculum. Whether you need help with NURS FPX 4020 Assessment 1 or any subsequent assessments, our tutors offer insights and strategies that are directly applicable to your studies.

Streamline Your Success in One Billing Cycle

Completing your nursing program efficiently and successfully is our top priority. With focused support for NURS FPX 4020 Assessment 2 and NURS FPX 4020 Assessment 3, among others, we aim to streamline your study process, enabling you to excel in your assessments and advance in your nursing career more rapidly.

Comprehensive Support for Every Assessment

Our support extends beyond just tutoring sessions. From "Take my assessment" services to "Online assessment help," we provide a full spectrum of resources designed to prepare you thoroughly for NURS FPX 4020 Assessment 4 and all other assessments in the series.

Elevate Your Nursing Career with Us

Embarking on the NURS FPX 4020 series with our expert tutoring services means setting yourself up for success. With personalized support, expert guidance, and comprehensive resources, you're not just preparing for assessments; you're preparing for a thriving career in nursing.

Take the first step towards excellence in your NURS FPX 4020 assessments.

Contact us today and discover how our expert tutoring can transform your nursing education journey.

답글 달기
comment-user-thumbnail
2024년 8월 26일

Excel in NURS FPX 4050 Assessments with Our Expert Online Tutoring!

Understanding NURS FPX 4050 Assessments
NURS FPX 4050 Assessments are crucial milestones in your nursing journey, designed to ensure you grasp vital healthcare concepts and can apply them effectively. From mastering patient care protocols to analyzing intricate medical scenarios, each evaluation—whether it's NURS FPX 4050 Assessment 1 or Assessment 3 Applying Ethical Principles—presents an opportunity for you to showcase your knowledge and skills.

Benefits of Our Nursing Test Assistance
Our team of seasoned tutors comprehends the nuances of these assessments and is committed to easing your learning journey. Whether you're grappling with the basics in Assessment 1 or navigating ethical dilemmas in NURS FPX 4050 Assessment 3, we're here to offer the assistance and direction you require to excel. Our tutors possess not only expertise in nursing but also familiarity with the unique requirements and expectations of each evaluation, ensuring you receive tailored guidance.

Customized Learning Support
We understand that every learner has distinct learning needs and preferences. Hence, our tutors adopt a personalized approach, adjusting their teaching methods and resources to align with your individual requirements. Whether you prefer visual aids, interactive exercises, or one-on-one discussions, we tailor our assistance to facilitate effective comprehension. Whether you're grappling with ethical principles in NURS FPX 4050 Assessment 4 or seeking refinement in your skills, our tutors are committed to providing the guidance you need to thrive.

Expert Tutors at Your Service
Our tutors are not only deeply knowledgeable in nursing concepts but also adept at navigating the complexities of NURS FPX 4050 Assessments. Whether you're struggling with deciphering intricate medical terminology, analyzing patient data, or applying ethical principles, our tutors are here to support you every step of the way. With their expertise and guidance, you can approach each assessment with confidence, knowing you have the necessary support to succeed.

Streamlined Progress Towards Your Goals
Recognizing the significance of efficiency in completing your nursing program, we focus on facilitating your progress through NURS FPX 4050 Assessments 2 and 3 efficiently. By offering targeted support and resources, we empower you to complete your BSN and MSN program within a single billing cycle, aiding you in reaching your academic goals more expeditiously.

Accelerate Your RN to BSN or MSN Journey
With our strategic, concentrated learning approach designed to optimize efficiency without compromising quality, you can expedite your journey from RN to BSN or RN to MSN. Our tutors are dedicated to helping you realize your academic and professional aspirations within the shortest possible timeframe, ensuring you're well-prepared for success in your nursing career.

Maximizing Your Educational Investment
At Nurs Assessment, we recognize the significance of your time and investment. Hence, we are committed to delivering high-quality, efficient tutoring services that enable you to excel in your NURS FPX 4050 Assessments and complete your course within a single billing cycle. With our support, you can maximize your nursing education and embark on a successful career journey with confidence.

Ready to Achieve Success?
Don't let the challenges of NURS FPX 4050 Assessments stand in your way. Contact us today and take the first step towards mastering your nursing assessments with confidence and efficiency. Our expert tutors are here to guide you every step of the way!

답글 달기