What do you want?81 Codility - Fish https://codility.com/demo/results/demoV445T8-FZN/ Task descriptionYou 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 river, ordered downstream along the flow of the river.The fish are numbered from 0 to N − 1. If P and Q are two fish and P < Q, then fish P is initially upstream of fish Q. Initially, each fish has a uni.. 2014. 10. 26. Codility - StoneWall https://codility.com/demo/results/demoFHGPX8-MAF/ Task descriptionSolution to this task can be found at our blog.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 should have different heights in different places. The height of the wall is specified by a zero-indexed array H of N positive integers. H[I] is the he.. 2014. 10. 25. Codility - Nesting Task descriptionA 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 string;S has the form "VW" where V and W are properly nested strings.For example, string "(()(())())" is properly nested but string "())" isn't.Write a function:class Solution { public int solution(String S); }that, given a string S consisting of N chara.. 2014. 10. 25. Codility - Brackets https://codility.com/demo/results/demoU2WQCE-QXU/ Task descriptionA string S consisting of N characters is considered to be properly nested if any of the following conditions is true:S is empty;S has the form "(U)" or "[U]" or "{U}" where U is a properly nested string;S has the form "VW" where V and W are properly nested strings.For example, the string "{[()()]}" is properly nested but "([)()]" .. 2014. 10. 25. Codility NumberOfDiscIntersections https://codility.com/demo/results/demo5472KB-8BH/ -------------------------문제---------------------------Given an array A of N integers, we draw N discs in a 2D plane such that the I-th disc is centered on (0,I) and has a radius of A[I]. We say that the J-th disc and K-th disc intersect if J ≠ K and J-th and K-th discs have at least one common point.Write a function:class Solution { public int so.. 2014. 10. 25. Codility - Triangle https://codility.com/demo/results/demoMMUZP3-QE3/ 주어진 문제를 제대로 읽자.. 난또 triangle이 이루어질 수 있는 조합의 개수인줄 알고 삽질하고 있었다. 근데 문제는 triangle이 있으면 1, 없으면 0을 출력하라는 문제였다. -------------------------- 만약 triangle이 이루어지는 조합의 개수를 출력하라고 했으면 어땠을까? 머리속에 드는 생각은 O(N*NlogN)이 아닌 O(N^2) 의 방법 밖에 생각이 안든다... 2014. 10. 25. 이전 1 ··· 8 9 10 11 12 13 14 다음