Question
Given a binary tree, collect a tree’s nodes as if you were doing this: Collect and remove all leaves, repeat until the tree is empty.
[Read More]
Question
You are given two jugs with capacities x and y litres. There is an infinite amount of water supply available. You need to determine whether it is possible to measure exactly z litres using these two jugs.
[Read More]
NumPy is the library that gives Python its ability to work with data at speed. Originally, launched in 1995 as ‘Numeric,’ NumPy is the foundation on which
many important Python data science libraries are built, including Pandas, SciPy and scikit-learn.
[Read More]
The Pandas library is one of the most preferred
tools for data scientists to do data manipulation and analysis, next to
matplotlib for data visualization and
NumPy, the fundamental library for scientific
computing in Python on which Pandas was built.
[Read More]
Question
Given a 2D grid, each cell is either a wall 'W', an enemy 'E' or empty '0' (the number zero), return the maximum enemies you can kill using one bomb.
[Read More]
Question
Given a sorted array of integers nums and integer values a, b and c. Apply a quadratic function of the form f(x) = ax2 + bx + c to each element x in the array.
[Read More]
Question
Design a simplified version of Twitter where users can post tweets, follow/unfollow another user and is able to see the 10 most recent tweets in the user’s news feed. Your design should support the following methods:
[Read More]
Question
Design a Snake game that is played on a device with screen size = width x height. Play the game online if you are not familiar with the game.
[Read More]
Question
Given an Android 3x3 key lock screen and two integers m and n, where 1 ≤ m ≤ n ≤ 9, count the total number of unlock patterns of the Android lock screen, which consist of minimum of m keys and maximum n keys.
[Read More]
Question For a undirected graph with tree characteristics, we can choose any node as the root. The result graph is then a rooted tree. Among all possible rooted trees, those with minimum height are called minimum height trees (MHTs). Given such a graph, write a function to find all the...
[Read More]