Ad
Code
Diff
  • using System;
    
    public class Sum
    {
       public Int64 GetSum(Int64 a, Int64 b) => a + b;
    }
    • using System;
    • public class Sum
    • {
    • public int GetSum(int a, int b) => a + b;
    • public Int64 GetSum(Int64 a, Int64 b) => a + b;
    • }
Algorithms
Logic
Code
Diff
  • def lostPencils(end):
        result = 0
    
        for i in range(1,end+1):
            result+=i
        
        return result
    • def lostPencils(end):
    • result = 0
    • current = 1
    • while current <= end:
    • result += current
    • current += 1
    • for i in range(1,end+1):
    • result+=i
    • return result
Code
Diff
  • public class BiggerNum{
    
      public static int compare(int a, int b) {
        if(a>b)
          return a;
        else
          return b;
      }
    
    }
    • public class BiggerNum{
    • public static int compare(int a, int b) {
    • return 0;
    • if(a>b)
    • return a;
    • else
    • return b;
    • }
    • }