摘要:
Write a function to find the longest common prefix string amongst an array of strings. 写一个函数(或方法)来寻找一个字符串数组中的最长公共前缀。 注释 阅读全文
posted @ 2017-10-16 21:32
daniel456
阅读(89)
评论(0)
推荐(0)
摘要:
Given a non-negative integer, you could swap two digits at most once to get the maximum valued number. Return the maximum valued number you could get. 阅读全文
posted @ 2017-10-16 20:52
daniel456
阅读(165)
评论(0)
推荐(0)
摘要:
Given two integers n and k, you need to construct a list which contains n different positive integers ranging from 1 to n and obeys the following requ 阅读全文
posted @ 2017-10-16 20:49
daniel456
阅读(295)
评论(0)
推荐(0)
摘要:
Given a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters represent different tasks.Tasks could 阅读全文
posted @ 2017-10-16 20:02
daniel456
阅读(638)
评论(0)
推荐(0)
摘要:
Given an array consists of non-negative integers, your task is to count the number of triplets chosen from the array that can make triangles if we tak 阅读全文
posted @ 2017-10-16 19:40
daniel456
阅读(123)
评论(0)
推荐(0)
摘要:
Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k. Example 1: Input:nums = 阅读全文
posted @ 2017-10-16 19:26
daniel456
阅读(160)
评论(0)
推荐(0)
摘要:
Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear twi 阅读全文
posted @ 2017-10-16 19:21
daniel456
阅读(119)
评论(0)
推荐(0)
摘要:
Design a data structure that supports all following operations in average O(1) time. 设计一个数据结构,使得插入、删除,随机获取一个元素的时间复杂度都是O(1) 阅读全文
posted @ 2017-10-16 17:41
daniel456
阅读(145)
评论(0)
推荐(0)
摘要:
Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. 阅读全文
posted @ 2017-10-16 16:55
daniel456
阅读(164)
评论(0)
推荐(0)
摘要:
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 except 阅读全文
posted @ 2017-10-16 16:41
daniel456
阅读(123)
评论(0)
推荐(0)

浙公网安备 33010602011771号