Skip to content

Commit

Permalink
Merge pull request #51 from godspeed5/master
Browse files Browse the repository at this point in the history
2 problems solved and Readme updated in reference to issue #9
  • Loading branch information
swapnanildutta authored Oct 9, 2020
2 parents e922df6 + da54ead commit 65aaa42
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Algorithms/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Algorithms

Xor-Sequence Solved in Python

Solve Me First solved in Python
- [Diagonal Difference](https://github.com/swapnanildutta/Hackerrank-Codes/blob/master/Algorithms/Diagonal%20Difference.js)
- Greedy
- Greedy
30 changes: 30 additions & 0 deletions Algorithms/Solve_Me_First.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# https://www.hackerrank.com/challenges/solve-me-first/problem
# Complete the function solveMeFirst to compute the sum of two integers.

# Function prototype:

# int solveMeFirst(int a, int b);

# where,

# a is the first integer input.
# b is the second integer input
# Return values

# sum of the above two integers
# Sample Input

# a = 2
# b = 3
# Sample Output

# 5
def solveMeFirst(a,b):
return a+b
# Hint: Type return a+b below


num1 = int(input())
num2 = int(input())
res = solveMeFirst(num1,num2)
print(res)
4 changes: 1 addition & 3 deletions Algorithms/Xor-sequence.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# https://www.hackerrank.com/challenges/xor-se/problem

# An array, , is defined as follows:
# A[0] = 0
# A[x] = A[x-1]^x
Expand Down Expand Up @@ -53,8 +52,7 @@ def A(x):
if(a == 6 or a == 7):
return 0;
ans = A(l-1)^A(r)
return ans



if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
Expand Down

0 comments on commit 65aaa42

Please sign in to comment.