Category: algorithms
You are given an array coordinates, coordinates = , where represents the coordinate of a point. Check if these points make a straight line in the XY plane. Input: …
Given an array nums of 0s and 1s and an integer k, return True if all 1’s are at least k places away from each other, otherwise return False. …
You are given the array paths, where paths = means there exists a direct path going from cityAi to cityBi. Return the destination city, that is, the city without …
A number chain is created by continuously adding the square of the digits in a number to form a new number until it has been seen before. For example, …
We have known the approach to merge two linked list in C++. We also know how to apply the merge sort algorithms to merge K sorted list. If you …