Score Points

Problem Overview

  • Compute the total score on a 1D board: add points[K] for each 'T' and add 1 for every adjacent 'T'-'T' pair.
  • Input: array points and string tokens of equal length N; Output: the integer total score.
  • Constraints: 1 ≤ N ≤ 100, points in [1,1000], tokens contain only 'E' or 'T'.
  • Real-world context: scoring tokens on a board using basic array and string processing.
  • A Google interviews coding interview problem and common interview question.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: