摘要: Given two strings s and t, write a function to determine if t is an anagram of s. For example,s = "anagram", t = "nagaram", return true.s = "rat", t = 阅读全文
posted @ 2017-07-16 21:55 immjc 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical a 阅读全文
posted @ 2017-07-16 21:46 immjc 阅读(129) 评论(0) 推荐(0) 编辑
摘要: Write a function to delete a node (except the tail) in a singly linked list, given only access to that node. Supposed the linked list is 1 -> 2 -> 3 - 阅读全文
posted @ 2017-07-16 21:17 immjc 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 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 that the 阅读全文
posted @ 2017-07-16 21:03 immjc 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Given scores of N athletes, find their relative ranks and the people with the top three highest scores, who will be awarded medals: "Gold Medal", "Sil 阅读全文
posted @ 2017-07-16 15:39 immjc 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: Note: You may assume the 阅读全文
posted @ 2017-07-16 14:58 immjc 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You may comple 阅读全文
posted @ 2017-07-16 14:41 immjc 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Given an array consisting of n integers, find the contiguous subarray of given length k that has the maximum average value. And you need to output the 阅读全文
posted @ 2017-07-16 13:38 immjc 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 给定一个整数,求出其在Excel对应的字母标题,利用while循环,先对整数取余(n - 阅读全文
posted @ 2017-07-16 12:21 immjc 阅读(153) 评论(0) 推荐(0) 编辑
摘要: Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, return its corresponding column number. For example: 给定 阅读全文
posted @ 2017-07-16 11:41 immjc 阅读(168) 评论(0) 推荐(0) 编辑