Javascript Array And String Questions Leetcode Rating Predictor