문제A 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 "([)()]" is not.Write a function:class Solution { public int solution(Str..
문제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 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 characters, returns..
문제An array A consisting of N integers is given. A triplet (P, Q, R) is triangular if 0 ≤ P A[R],A[Q] + A[R] > A[P],A[R] + A[P] > A[Q].For example, consider array A such that: A[0] = 10 A[1] = 2 A[2] = 5 A[3] = 1 A[4] = 8 A[5] = 20Triplet (0, 2, 4) is triangular.Write a function:def solution(A)that, given an array A consisting of N integers, returns 1 if there exists..
