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 →

  • borb_ 2 years ago+ 1 comment

    You can do the same thing in C# ->

    return grades.Select(grade => grade < 38 || (grade % 5 < 3) ? grade :  grade + (5 - grade % 5 )).ToArray();
    

    return grades.Select(grade => grade < 38 || (grade % 5 < 3) ? grade : grade + (5 - grade % 5 )).ToArray();

    7|
    ParentPermalink
    • sidra_mbn 1 year ago+ 1 comment

      Excellent

      0|
      ParentPermalink
      • sidra_mbn 1 year ago+ 1 comment

        Can you please also tell me that ToArray is to be used only when we are returning an array?

        0|
        ParentPermalink
        • moh_so2001 1 year ago+ 0 comments
          foreach(`$grades as $`grade){ 
          

          grade < 38 || grade : grade % 5))); } return $g;

          php code

          0|
          ParentPermalink
  • Contest Calendar
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature