Solve Me First

Sort by

recency

|

1031 Discussions

|

  • + 0 comments

    The typescript initial code is incomplete!

  • + 0 comments
    #include <stdio.h>
    
    int solveMeFirst(int a, int b) {
        return a + b;
     
    }
    
    int main() {
        int num1,num2;
        scanf("%d %d",&num1,&num2);
        int sum; 
        sum = solveMeFirst(num1,num2);
        printf("%d",sum);
        return 0;
    }
    
  • + 0 comments

    There is no way i found for the answer... using typescript i declared a function and when I call the function for (2,3) it is true but (100,1000) false. When I call two functions it is false again and I cannot submit it. Is there anyone who did it right??? WASE

  • + 0 comments

    Bash Solution:

    solveMeFirst() {
      local a=$1
      local b=$2
    
      
      if (( a < 1 || b > 1000 )); then
        echo "Error: inputs must be in range 1..1000" >&2
        exit 1
      fi
    
      # print the sum
      echo $(( a + b ))
    }
    
    # read two numbers (space- or newline-separated)
    read -r a
    read -r b
    
    solveMeFirst "$a" "$b"
    
  • + 2 comments

    Here is HackerRank all algorithms problems solutions - HackerRank Algorithms solutions