Design and implementation of a special kind of stack called a MinStack. The MinStack supports the usual stack operations such as push, pop, and top, but it also provides a method to retrieve the minimum element in constant time, O(1).
You are keeping the scores for a baseball game with a unique set of rules. At the beginning of the game, you start with an empty record. You're given a list of strings operations, where each element represents an operation to apply to the record.
You are given an integer array nums of length n. The task is to create a new array ans of length 2n such that ans[i] == nums[i] and ans[i + n] == nums[i] for 0 <= i < n (0-indexed). In simpler terms, the array ans is formed by concatenating two copies of the array nums.
The problem at hand is to remove duplicates from a sorted integer array nums in-place, such that each unique element appears only once. Additionally, we need to return the number of unique elements present in the modified array.
You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively. Merge nums1 and nums2 into a single array sorted in non-decreasing order.