Tag: C++ coding exercise
Given two positive integers x and y, an integer is powerful if it is equal to x^i + y^j for some integers i >= 0 and j >= 0. …
How to Check if Any Three Points can Make a Triangle? There are many ways to check if any given three points in 2D plane can make a triangle. …
Design a class to find the kth largest element in a stream. Note that it is the kth largest element in the sorted order, not the kth distinct element. …
Normally, the factorial of a positive integer n is the product of all positive integers less than or equal to n. For example, factorial(10) = 10 * 9 * …
In a town, there are N people labelled from 1 to N. There is a rumor that one of these people is secretly the town judge. If the town …