Hackerrank Time Conversion (C++)
C++ : Explanation: Ok, this problem gave quite some headaches with the corner cases of 12PM and 12AM. Had to use some hackos to see the corner cases missed. But first, the general...
C++ : Explanation: Ok, this problem gave quite some headaches with the corner cases of 12PM and 12AM. Had to use some hackos to see the corner cases missed. But first, the general...
C++ : Explanation: There are 2 loops in this function. Basically this function is a combination of a findMax function and a countMax function. The first loop finds the max number in the...
C++ : Explanation: Using a nested for loop here, the outer loop denotes the number to skip when summing the vector, for the first loop, skip arr[0], then arr[1]… etc. The inner loops...
C++ : Explanation: This is one of our favorites. Used to print stars (*) in school assignments previously, now we are printing hashtags (#). The loop for j is to take care of...
C++ : Explanation: pos is the number of positive integers in the vector, neg is the number of negative integers in the vector, and zero is the number of zeros in the vector....
C++ : Explanation: Basically, this is like a tic tac toe puzzle. It goes something like this for a 3 by 3: [0][0] [0][1] [0][2][1][0] [1][1] [1][2][2][0] [2][1] [2][2] But first, we check...
C++: Explanation: Just summing up the value of each vector and adding it to result. At the end, return result.
C++ : Explanation: A bit of hard coding here, not the most elegant solution. But hey it works. The for loop compares each number in both vectors a and b at index i...
C++ : Explanation: Seriously no explanation for this one. Just follow the instructions in the comments.