Female Coding Pioneer
Ada Lovelace, the first programmer and a visionary mathematician, was chiefly known for her work on Charles Babbage's proposed mechanical general-purpose computer, the Analytical Engine. She was fond of sequences. During her studies she came across an infinite sequence that was generated using the following algorithm, starting with an empty sequence. Starting from step number 1, in step number i, the integer i is appended to the sequence exactly k times where k is equal to the number of set bits in i. Given an array query of n integers, for each query, find the value at the given index of the array assuming indexing starts at 0 . Report an array of n integers where the x th integer represents the answer to the x th query. Example Given, n = 2 and query = [4, 10], the sequence is generated as follows. Step Number Bina...