Category: coding exercise
Given an array of integers, 1 ≤ a ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear …
Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Input: Output: 3 Explanation: The first two digits or the last three digits …
Question: Write a function to compute the number of bits required to convert a integer to another. For example, Input 29 (or 11101), 15 (or 01111) the output is …
Question: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add …
Question: Implement the inspect_bits function to check if any given 32-bit integer contains 2 or more consecutive ones in its binary representation. If it does, the function should return …