BirthdayCakeCandles

ProblemĀ from Hackerrank.

My solution:

 

Mini-Max Sum

ProblemĀ from Hackerrank.

My solution:

 

Staircase

ProblemĀ from Hackerrank.

My solution:

 

Plus Minus

ProblemĀ from Hackerrank.

I was making the mistake of checking if the index was bigger or smaller than zero, instead of checking the value of the integer in that index. I was comparingĀ iĀ instead ,arr[i].

My solution:

 

Diagonal Difference

ProblemĀ from Hackerrank.

 

Simply Array Sum

Problem from HackerRank.

Easy problem but I got confused with the index of the array and its value. I was adding iĀ to my result variable and not ar[i].

 

Compare the Triplets

ProblemĀ from Hackerrank.

Got some issues figuring out why it didn’t work my function. Two mental notes:

I am still have some problems with indentation and that can cause to put my return value inside the for loop without noticing.

I keep writing the operator “+=” as “=+”. How annoying! I read a good article about it and I finally got it.

My solution: