We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Loading...
  • Practice
  • Compete
  • Jobs
  • Leaderboard
  1. Practice
  2. Algorithms
  3. Implementation
  4. Grading Students
  5. Discussions

Grading Students

  • Problem
  • Submissions
  • Leaderboard
  • Discussions
  • Editorial

    You are viewing a single comment's thread. Return to all comments →

  • lukus_2222 1 year ago+ 0 comments

    neat

    heres the same solution in PHP

    function solve($grades){
    
    for ($i=0;$i <= sizeof($grades); $i++){
        if ($grades[$i] >= 38){
            if ($grades[$i] % 5 == 3){
                $grades[$i] += 2;
            }
            else if ($grades[$i] % 5 == 4){
                $grades[$i] += 1;
            }
        }
    }
          
        return $grades;
    }
    
    0|
    ParentPermalink
  • Contest Calendar
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature