Home | Archives | Tags | About |
|
QuestionGiven a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1: Input: “babad”O
QuestionWrite a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: A:
QuestionGiven a binary tree, return the inorder traversal of its nodes’ values. Example: Input: [1,null,2,3] 1 \ 2 / 3 Output: [1,3,2] Follow up: Recu
QuestionGiven a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and
QuestionYou are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their node
QuestionGiven an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the function should: Return
QuestionGiven a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] i
QuestionGiven a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node conta
QuestionGiven a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[‘ and ‘]’, determine if the input string is valid. An input string is vali
QuestionGiven an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing from the array. Example 1: Input: [3,0,1]O
QuestionRoman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For examp
QuestionGiven an integer, write a function to determine if it is a power of three. Example 1: Input: 27Output: trueExample 2: Input: 0Output: falseExa
QuestionCount the number of prime numbers less than a non-negative number, n. Example: Input: 10Output: 4Explanation: There are 4 prime numbers less t
QuestionWrite a program that outputs the string representation of numbers from 1 to n. But for multiples of three it should output “Fizz” instead of t
QuestionDesign a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) – Push element x onto stack. pop() –
QuestionYou are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint sto
QuestionGiven two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:The number of elements initialized in nums1 a
QuestionYou are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the q
QuestionGiven an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. Examp
TBC