Given an integer n, return an array ans of length n + 1 such that for each i (0 <= i <= n), ans[i] is the number of 1's in the binary representation of i.
Two words are anagrams of one another if their letters can be rearranged to form the other word. Given a string, split it into two contiguous substrings of equal length. Determine the minimum number of characters to change to make the two substrings into anagrams of one another.
We are very near to our goal now. The enemy is being weakened continuously. But alas, sensing his fall, the hacker has spread a worm into our network. It is consuming all our files at a tremendous rate and must be stopped at all costs. The only way to stop it is to enter a specific code number in to the worm.
The first and the last digits of the price were not readable. Although, the number of nails in the box could be read clearly. The box read,
72 nails, Rs. _679_
Someone is trying to break into Thapar University’s Database and steal sensitive research information. It is now up to us to stop this attack. Fortunately our defence mechanisms have traced the attacks to their source. The fastest way to stop the attacks is to disable the source.
Given two strings, A and B, output true if B is a substring of A and false otherwise. The first line contains the number of test cases T. This is followed by T lines each consisting of pairs of binary strings A and B.