摘要:
题目要求 Given two strings s and t , write a function to determine if t is an anagram of s. 题目分析及思路 给出两个字符串s和t,要求判断t是否是s的一个anagram,即由相同的字母且不同的字母顺序组成。可以使用c 阅读全文
摘要:
题目要求 Roman numerals are represented by seven different symbols: I, V, X, L, C, Dand M. For example, two is written as II in Roman numeral, just two on 阅读全文
摘要:
题目要求 Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume tha 阅读全文
摘要:
题目要求 Design a HashSet without using any built-in hash table libraries. To be specific, your design should include these functions: add(value): Insert 阅读全文
摘要:
题目要求 Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given targ 阅读全文
摘要:
题目要求 Given a word, you need to judge whether the usage of capitals in it is right or not. We define the usage of capitals in a word to be right when o 阅读全文
摘要:
题目要求 In a binary tree, the root node is at depth 0, and children of each depth k node are at depth k+1. Two nodes of a binary tree are cousins if they 阅读全文
摘要:
题目要求 Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. 题目分析及思路 要求写一个函数,删除一个单链表中的一个结点(除了最后一个 阅读全文
摘要:
题目要求 Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more lette 阅读全文
摘要:
题目要求 Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and all the 0's and all the 1's 阅读全文