Category: algorithms
Given n non-negative integers a1, a2, …, an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of …
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 …
It is said a Google Interview Question: You are given two eggs to test the minimal height (from 1 to 100) the egg will break if dropped at that …
Task: Merge two given sorted integer array A and B into a new sorted integer array. Example A=, B=, return This is the final step of the merge sort …
Write a method to check if a given integer is a perfect square e.g. 4, 9, 16, 25 … you cannot use the sqrt or pow functions. One solution …