Evaluating student grades


You are given a string representing all letter grades a student as earned. The record only contains the following three characters:

  • 'A' : Excellent
  • 'B' : Good
  • 'C' : Average
  • 'D' : Below Average
  • 'F' : Deficient

A student will be given a diploma if their record has:

  • Less than 5 D's
  • Less than 2 F's
  • No more than 3 consecutive D's

Given a string, write a function to return whether a given student will be given a diploma.


Access restricted

Subscribe to premium account to see the solution.

Get premium now