Winning Lottery Ticket
The SuperBowl Lottery is about to commence, and there are several lottery tickets being sold, and each ticket is identified with a ticket ID. In one of the many winning scenarios in the Superbowl lottery, a winning pair of tickets is: Concatenation of the two ticket IDs in the pair, in any order, contains each digit from to at least once. For example, if there are distinct tickets with ticket ID and , is a winning pair. NOTE: The ticket IDs can be concantenated in any order. Digits i
View Solution →Xoring Ninja
An XOR operation on a list is defined here as the xor () of all its elements (e.g.: ). The of set is defined here as the sum of the s of all non-empty subsets of known as . The set can be expressed as: For example: Given set The set of possible non-empty subsets is: The of these non-empty subsets is then calculated as follows: = Given a list of space-separated integers, determine and print . For example, . There are three possible subsets, . The XOR of , of and of
View Solution →Cipher
Jack and Daniel are friends. They want to encrypt their conversations so that they can save themselves from interception by a detective agency so they invent a new cipher. Every message is encoded to its binary representation. Then it is written down times, shifted by bits. Each of the columns is XORed together to get the final encoded string. If and it looks like so: 1001011 shift 0 01001011 shift 1 001001011 shift 2 0001001011 shift 3 ---------- 1110101001 <- XORe
View Solution →XOR Matrix
Consider a zero-indexed matrix with rows and columns, where each row is filled gradually. Given the first row of the matrix, you can generate the elements in the subsequent rows using the following formula: Each row is generated one by one, from the second row through the last row. Given the first row of the matrix, find and print the elements of the last row as a single line of space-separated integers. Note: The operator denotes bitwise XOR. Input Format The first line contains
View Solution →What's Next?
Johnny is playing with a large binary number, . The number is so large that it needs to be compressed into an array of integers, , where the values in even indices () represent some number of consecutive bits and the values in odd indices () represent some number of consecutive bits in alternating substrings of . For example, suppose we have array . represents , represents , represents , represents , and represents . The number of consecutive binary characters in the substring of cor
View Solution →