程序媛詹妮弗
终身学习
摘要: Given a non-empty array of integers, return the k most frequent elements. For example,Given [1,1,1,2,2,3] and k = 2, return [1,2]. Note: You may assum 阅读全文
posted @ 2018-06-09 03:08 程序媛詹妮弗 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Given a string array words, find the maximum value of length(word[i]) * length(word[j]) where the two words do not share common letters. You may assum 阅读全文
posted @ 2018-06-09 02:59 程序媛詹妮弗 阅读(183) 评论(0) 推荐(0) 编辑
摘要: Given a list of non negative integers, arrange them such that they form the largest number. 题意: 给定一堆数字,将它们排列顺序,使其连一块儿能形成最大的数。 思路: 先转化成一个字符串数组 然后把这个数组按 阅读全文
posted @ 2018-06-09 01:50 程序媛詹妮弗 阅读(285) 评论(0) 推荐(0) 编辑
摘要: Design a class which receives a list of words in the constructor, and implements a method that takes two words word1 and word2 and return the shortest 阅读全文
posted @ 2018-06-07 02:10 程序媛詹妮弗 阅读(188) 评论(0) 推荐(0) 编辑
摘要: Given a list of words and two words word1 and word2, return the shortest distance between these two words in the list. Example:Assume that words = ["p 阅读全文
posted @ 2018-06-07 01:43 程序媛詹妮弗 阅读(215) 评论(0) 推荐(0) 编辑
摘要: Implement pow(x, n), which calculates x raised to the power n (xn). Example 1: Example 2: Example 3: 题意: 求幂 思路: 指数n 大于0 返回 power(x, n) 小于0 返回 1.0 / po 阅读全文
posted @ 2018-06-07 01:21 程序媛詹妮弗 阅读(147) 评论(0) 推荐(0) 编辑
摘要: The count-and-say sequence is the sequence of integers with the first five terms as following: 1 is read off as "one 1" or 11.11 is read off as "two 1 阅读全文
posted @ 2018-06-06 02:26 程序媛詹妮弗 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 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 time 阅读全文
posted @ 2018-06-06 02:07 程序媛詹妮弗 阅读(213) 评论(0) 推荐(0) 编辑
摘要: Given two strings s and t , write a function to determine if t is an anagram of s. Example 1: Example 2: 题意: 验证变位词 何谓anagram? 思路: 用int[] map = new int 阅读全文
posted @ 2018-06-06 01:21 程序媛詹妮弗 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Determine if a 9x9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules: The Sudoku board could be parti 阅读全文
posted @ 2018-06-06 01:13 程序媛詹妮弗 阅读(235) 评论(0) 推荐(0) 编辑