Hackerrank Day of the Programmer (C++)
C++ : Explanation: Happy Russian birthday programmers! This is a fun one. First, check for leap years in both the Julian and Gregorian calendars in the during or before 1917, and the years...
C++ : Explanation: Happy Russian birthday programmers! This is a fun one. First, check for leap years in both the Julian and Gregorian calendars in the during or before 1917, and the years...
C++ : Explanation: First, a frequency vector of size 5 is initialized to all 0s. For each type of bird in arr, count the frequency of the bird in the first for loop....
C++ : Explanation: This is about adding two numbers at ar[i] and ar[j], such that the sum is divisible by k. n is the ar.size(), which is actually no need to be provided,...
C++ : Explanation: This problem is about summing up a continuous m number of numbers in vector s such that they add up to d. Why a do while loop instead of a...
C++ : Explanation: This one is simple. First, set both lowest and highest score to the first element of vector scores. Next, in the for loop, check if each element is higher than...
C++ : Explanation: Ok, this one is a nice little challenge on divisors and factors. First, find the largest number in vector a and smallest number in vector b. Next, set the (temporary)...
C++ : Explanation: Make jumps (the number of max times the kangaroos can jump) an arbitrarily large number (such as 100,000 as above), then in the while loop, check if starting distance of...
C++ : Explanation: As stated in the problem, 38 is the cut off number for rounding, so we’ll go with 38 for the base number instead of having to count from 40. Modding...
C++ : Explanation: Basically doing some simple arithmetic and counting the numbers that appear in a range for 2 separate vectors. Nothing really complicated here.
C++ : Explanation: Missed this all the way till the last warmup challenge. This is simple, simply adding up all the elements of a vector in sum, then returning it. Nothing much to...