Given an array of integers A, return the largest integer that only occurs once. If no integer occurs once, return -1. Example 1: Input: Output: 8 Explanation: The maximum …
Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as …
Given a string and an integer k, you need to reverse the first k characters for every 2k characters counting from the start of the string. If there are …
Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: We can use the …
Given preorder and inorder traversal of a tree, construct the binary tree. You may assume that duplicates do not exist in the tree. For example, given preorder = inorder …
You have 4 cards each containing a number from 1 to 9. You need to judge whether they could operated through *, /, +, -, (, ) to get …