Tag: C++ coding exercise
A valid parentheses string is either empty (“”), “(” + A + “)”, or A + B, where A and B are valid parentheses strings, and + represents string …
Given a non-negative integer c, your task is to decide whether there’re two integers a and b such that a^2 + b^2 = c. Example 1: Input: 5 Output: …
Given two strings A and B of lowercase letters, return true if and only if we can swap two letters in A so that the result equals B. Example …
We define the Perfect Number is a positive integer that is equal to the sum of all its positive divisors except itself. Now, given an integer n, write a …
Given an array A of integers, for each integer A we may choose any x with -K <= x <= K, and add x to A. After this process, …