摘要:
题目: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikip 阅读全文
摘要:
题目: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at a 阅读全文
摘要:
题目: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in 阅读全文
摘要:
题目: You are playing the following Bulls and Cows game with your friend: You write down a number and ask your friend to guess what the number is. Each 阅读全文
摘要:
题目: Given a singly linked list, determine if it is a palindrome. 判断一个单链表是不是回文 思路: 1、遍历整个链表,将链表每个节点的值记录在数组中,再判断数组是不是一个回文数组,时间复杂度为O(n),但空间复杂度也为O(n),不满足空 阅读全文
摘要:
题目: Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums exc 阅读全文