Statement Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as large as possible. 2n 個の整数値の配列が与…

Statement Given a string S that only contains "I" (increase) or "D" (decrease), let N = S.length. Return any permutation A of [0, 1, ..., N] such that for all i = 0, ..., N-1: - If S[i] == "I", then A[i] < A[i+1] - If S[i] == "D", then A[i…

Statement The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calculate the Hamming distance. "ハミング距離" とは2つの整数値の"距離"のことです "距…

Statement Given an array of integers arr, write a function that returns true if and only if the number of occurrences of each value in the array is unique. 整数値の配列が与えられる、それぞれの要素の個数の 出現数が一意であればtrueを返せ Con…