Hackerrank – Beautiful Triplets

Hackerrank – Problem Statement A description of the problem can be found on Hackerrank. Solution I checked each consequent combination of (i, j, k), if it is valid according to condition. There is a catch. I had to stop an iteration if array[j] – array[i]

Hackerrank – Strange Counter

Hackerrank – Problem Statement A description of the problem can be found on Hackerrank. Solution I calculated time in the cycle when counter value is 1: last_time_next_cycle = actual_cycle_time + 2 * (last_time_actual_cycle – last_time_previous_cycle). The difference in seconds between cycle 0 and cycle 1 is 3, which is always like that. For a given […]