随笔分类 -  Java

1 2 下一页

Leetcode---35. Search Insert Position
摘要:Description: Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were i 阅读全文

posted @ 2017-10-22 10:09 Hugh_Sun 阅读(154) 评论(0) 推荐(0)

Codility---CountFactors
摘要:Task description A positive integer D is a factor of a positive integer N if there exists an integer M such that N = D * M. For example, 6 is a factor 阅读全文

posted @ 2017-06-13 23:06 Hugh_Sun 阅读(428) 评论(0) 推荐(0)

Codlility---MinPerimeterRectangle
摘要:Task description An integer N is given, representing the area of some rectangle. The area of a rectangle whose sides are of length A and B is A * B, a 阅读全文

posted @ 2017-06-12 09:07 Hugh_Sun 阅读(280) 评论(0) 推荐(0)

Codility---MaxDoubleSliceSum
摘要:Task description A non-empty zero-indexed array A consisting of N integers is given. A triplet (X, Y, Z), such that 0 ≤ X < Y < Z < N, is called a dou 阅读全文

posted @ 2017-06-12 08:34 Hugh_Sun 阅读(345) 评论(0) 推荐(0)

Codility---MaxProfit
摘要:Task description A zero-indexed array A consisting of N integers is given. It contains daily prices of a stock share for a period of N consecutive day 阅读全文

posted @ 2017-06-11 11:27 Hugh_Sun 阅读(639) 评论(0) 推荐(0)

Codility---EquiLeader
摘要:Task description A non-empty zero-indexed array A consisting of N integers is given. The leader of this array is the value that occurs in more than ha 阅读全文

posted @ 2017-06-11 10:30 Hugh_Sun 阅读(404) 评论(0) 推荐(0)

Codility---Dominator
摘要:Task description A zero-indexed array A consisting of N integers is given. The dominator of array A is the value that occurs in more than half of the 阅读全文

posted @ 2017-06-11 10:00 Hugh_Sun 阅读(337) 评论(0) 推荐(0)

Codility---StoneWall
摘要:Task description You are going to build a stone wall. The wall should be straight and N meters long, and its thickness should be constant; however, it 阅读全文

posted @ 2017-05-17 00:16 Hugh_Sun 阅读(352) 评论(0) 推荐(0)

Codility---Nesting
摘要:Task description A string S consisting of N characters is called properly nested if: S is empty; S has the form "(U)" where U is a properly nested str 阅读全文

posted @ 2017-05-16 23:29 Hugh_Sun 阅读(503) 评论(0) 推荐(0)

Codility---Fish
摘要:Task description You are given two non-empty zero-indexed arrays A and B consisting of N integers. Arrays A and B represent N voracious fish in a rive 阅读全文

posted @ 2017-05-02 11:03 Hugh_Sun 阅读(168) 评论(0) 推荐(0)

Codility---MaxSliceSum
摘要:Task description A non-empty zero-indexed array A consisting of N integers is given. A pair of integers (P, Q), such that 0 ≤ P ≤ Q < N, is called a s 阅读全文

posted @ 2017-05-01 22:25 Hugh_Sun 阅读(354) 评论(0) 推荐(0)

Codility---Brackets
摘要:Task description A string S consisting of N characters is considered to be properly nestedif any of the following conditions is true: S is empty; S ha 阅读全文

posted @ 2017-05-01 00:31 Hugh_Sun 阅读(381) 评论(0) 推荐(0)

Codility--- NumberOfDiscIntersections
摘要:Task description We draw N discs on a plane. The discs are numbered from 0 to N − 1. A zero-indexed array A of N non-negative integers, specifying the 阅读全文

posted @ 2017-04-30 23:43 Hugh_Sun 阅读(630) 评论(0) 推荐(0)

Codility---MaxProductOfThree
摘要:Task description A non-empty zero-indexed array A consisting of N integers is given. Theproduct of triplet (P, Q, R) equates to A[P] * A[Q] * A[R] (0 阅读全文

posted @ 2017-04-29 08:30 Hugh_Sun 阅读(263) 评论(0) 推荐(0)

Codility--- Triangle
摘要:Task description A zero-indexed array A consisting of N integers is given. A triplet (P, Q, R) is triangular if 0 ≤ P < Q < R < N and: A[P] + A[Q] > A 阅读全文

posted @ 2017-04-29 07:53 Hugh_Sun 阅读(583) 评论(0) 推荐(0)

Codility--- Distinct
摘要:Task description Write a function class Solution { public int solution(int[] A); } that, given a zero-indexed array A consisting of N integers, return 阅读全文

posted @ 2017-04-29 07:22 Hugh_Sun 阅读(360) 评论(0) 推荐(0)

Codility---MinAvgTwoSlice
摘要:Task description A non-empty zero-indexed array A consisting of N integers is given. A pair of integers (P, Q), such that 0 ≤ P < Q < N, is called a s 阅读全文

posted @ 2017-04-28 12:09 Hugh_Sun 阅读(261) 评论(0) 推荐(0)

Codility---GenomicRangeQuery
摘要:Task description A DNA sequence can be represented as a string consisting of the letters A, C, G and T, which correspond to the types of successive nu 阅读全文

posted @ 2017-04-28 11:32 Hugh_Sun 阅读(590) 评论(0) 推荐(0)

Codility----PassingCars
摘要:Task description A non-empty zero-indexed array A consisting of N integers is given. The consecutive elements of array A represent consecutive cars on 阅读全文

posted @ 2017-04-28 10:10 Hugh_Sun 阅读(331) 评论(0) 推荐(0)

Codility---CountDiv
摘要:Task description Write a function: class Solution { public int solution(int A, int B, int K); } that, given three integers A, B and K, returns the num 阅读全文

posted @ 2017-04-28 09:38 Hugh_Sun 阅读(370) 评论(0) 推荐(0)

1 2 下一页

导航