Close

Forming the nth binary sequence

A binary sequence contains 0 and 1 only S.No  Binary sequence——————–1     02     13     004     015     10…Given a number k, we have to design an algorithm to print kth binary sequence. Initial approach (not efficient): Starting from the sequence 0, this algorithm iterates k times. To get the next sequence, in each iteration we do the following. check the last…

Next Round – A problem from Codeforces

This problem is from Codeforces. If you want to solve this problem on your own, follow this link. Here is the simplified problem statement. Given a list of scores of contestants in a competition, arranged in decreasing order. We have to calculate the number of people qualified for the next round.This is determined as follows,…