Author: ACMer
In Python, we can check if an array or list contains duplicate items using the following one-liner function. def contain_duplicates(list): return len(set(list)) != len(list) The idea is to convert …
A Stepping Number is an integer such that all of its adjacent digits have an absolute difference of exactly 1. For example, 321 is a Stepping Number while 421 …
Given three integer arrays arr1, arr2 and arr3 sorted in strictly increasing order, return a sorted array of only the integers that appeared in all three arrays. Example 1: …
You are given a string s that consists of lower case English letters and brackets. Reverse the strings in each pair of matching parentheses, starting from the innermost one. …
You have some apples, where arr is the weight of the i-th apple. You also have a basket that can carry up to 5000 units of weight. Return the …