Learn DSADSAContests
coding75 logo
LeetCode POTDPOTDSheets
coding75 Pro
coding75 logo
Dashboard
Learn DSA
Course RoadmapFlow
DSA Topic TreeNew πŸš€
Contest SolutionsPractice
Practice Sheets
MasterclassesLive πŸ‘¨πŸ»β€πŸ’»

coding75 ProPRO

Live Classes & Placement Guidance

coding75 logo

The premier developer platform for mastering Data Structures & Algorithms, exploring contest editorials, building ATS-ready resumes, and accelerating your tech career.

Connect & Community

DSA & Contests

  • Learn DSA
  • Contest Solutions
  • LeetCode POTDDaily
  • Practice Sheets
  • MasterclassesSoon

Interview Prep

  • Portfolio Projects
  • CS Fundamentals
  • System DesignSoon
  • Interview ExperiencesSoon
  • Mock InterviewsSoon

Career & Pro

  • Jobs & Internships
  • Resume BuilderATS
  • coding75 Pro
  • Submit Feedback
Β© 2026coding75β€’crackDSAβ„’β€’Maa Lalita Edtech Private Limited. All Rights Reserved.
Privacy PolicyTerms & ConditionsContact Support
Registered Office: Kanpur 208021β€’Regional Office: Indiranagar, Bangalore, 560008
Maa Lalita Edtech Private Limited
Contests/LeetCode/Biweekly Contest 182/Score Validator
Next
LeetCodeLeetCode
Easy
Biweekly Contest 182

Score Validator

StringArrayMath
Loading...
Solve on LeetCode

Problem Statement

Official algorithmic problem description and constraints.

Open on LeetCode

You are given a string array events.


Initially, score = 0 and counter = 0. Each element in events is one of the following:


"0", "1", "2", "3", "4", "6": Add that value to the total score.

"W": Increase the counter by 1. No score is added.

"WD": Add 1 to the total score.

"NB": Add 1 to the total score.

Process the array from left to right. Stop processing when either:


All elements in events have been processed, or

The counter becomes 10.

Return an integer array [score, counter], where:


score is the final total score.

counter is the final counter value.

 


Example 1:


Input: events = ["1","4","W","6","WD"]


Output: [12,1]


Explanation:


Event Score Counter

"1" 1 0

"4" 5 0

"W" 5 1

"6" 11 1

"WD" 12 1

Final result: [12, 1].


Example 2:


Input: events = ["WD","NB","0","4","4"]


Output: [10,0]


Explanation:


Event Score Counter

"WD" 1 0

"NB" 2 0

"0" 2 0

"4" 6 0

"4" 10 0

Final result: [10, 0].


Example 3:


Input: events = ["W","W","W","W","W","W","W","W","W","W","W"]


Output: [0,10]


Explanation:


After 10 occurrences of "W", the counter reaches 10, so processing stops. The remaining events are ignored.


 


Constraints:


1 <= events.length <= 1000

events[i] is one of "0", "1", "2", "3", "4", "6", "W", "WD", or "NB".


Note: Please do not copy the description during the contest to maintain the integrity of your submissions.

Solutions & Walkthrough

Detailed video explanations, mathematical intuition, and clean C++ implementation code.

Connecting secure classroom stream...
Back to Biweekly Contest 182
Next Problem