Given an integer array nums, move all the zeros to the end while maintaining the relative order of the non-zero elements. Perform the operation in-place without making a copy of the array.
You are given an array nums of n + 1 integers where each integer is in the range [1, n]. The array contains exactly one duplicate number. Find and return this duplicate number without modifying the array and using constant extra space.
Given an integer array ’nums’, find the length of the longest strictly increasing subsequence. A subsequence is a sequence derived by deleting some elements without changing the order of the remaining elements.
You are given an integer array ‘prices’, where ‘prices[i]’ represents the price of a stock on the i-th day. You are allowed to complete as many transactions as you like, with the restriction that after selling a stock, you cannot buy again the next day (cooldown). The goal is to calculate the maximum profit you can achieve by making any number of transactions while respecting the cooldown period.
Given a list of words, return the maximum product of lengths of two words such that the two words do not share common letters. If no such pair exists, return 0.
You are given a set of coins with different denominations and a target amount. Your task is to determine the fewest number of coins required to make the target amount. If it’s not possible, return -1.