Tag: algorithms
In a array A of size 2N, there are N+1 unique elements, and exactly one of these elements is repeated N times. Return the element repeated N times. Example …
Given an integer N, find out the number of method to sum up to N by integers given the following requirements: Natural Numbers (Postive Integers) need to be strictly …
Similar to Parity Sorting, the Index Parity Sorting can be applied to an array of integers that have equal number of even numbers and odd numbers. You are to …
Given any string (assume both lowercase or uppercase letters), check if a permutation of the string could form a palindrome. For example, canPermutePalindrome(“aab”) = true while canPermutePalindrome(“ab”) = false. …
The Wiggle Sorting may produce more than one possible outcome as long as the final sorted array satisfies: nums <= nums >= nums <= nums Given an unsorted array …