Tag: C++ coding exercise
The Interview Question: Assume the Rand5() gives a random integer from 1 to 5. Each possible return is given with the same probability. How do you construct the Rand7() …
You are asked to find the number of order pairs (x, y) such that, and x, y are natural numbers which also satisfy . Mathematics This shouldn’t be too …
There is a 2D binary matrix M filled with 0’s and 1’s, your task is to find the largest square containing all 1’s and return its area. For example, …
Question: Write a function to return the intersection of two arrays: For example, the intersection of and returns . The return array should only contain unique numbers and the …
Question: How to determine if a linked list has a cycle? The Singly Linked List is defined as follows: struct ListNode { int val; ListNode *next; ListNode(int x) : …