Category: programming languages
Remove the nth node from the end of a singly linked list and return its head. For example, input: 1-2-3-4-5, and n = 2. Removing the second node from …
Implement a basic calculator to evaluate a simple expression string. The expression string contains only non-negative integers, +, -, *, / operators and empty spaces . The integer division …
Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level). For example: 3 / \ 9 20 / …
Find the least number of perfect square numbers (1, 4, 9, 16, 25 …) which sum to the given integer n. For example, given n = 5, return 2 …
Given a singly linked list, determine if it is a palindrome. A palindrome is a string/number that mirrors itself, for example, 21312 reverse is also 21312. We are given …