Title: Design a data structure SpecialStack that supports all stack operations, such as push(), pop(), isEmpty(), isFull() and additional operations getMin(), which should return the smallest element in the SpecialStack. All of these operations of the SpecialStack must be O(1). To implement SpecialStack, you should only use standard stack data structures, and not other data structures such as arrays,…
Given two integers X and Y, find the smallest number X with the sum of the numbers, which is strictly greater than Y. Example: Input: X = 18, Y = 99Output: 189 Description: 189 is the smallest number greater than 99, and the sum of digits = 18.Input: X = 12, Y = 72Output: 75Description:…
Given two positive integers L and R, the task is to calculate the elements in the range [L, R] whose main factors are only 2 and 3. Example: Input: L = 1, R = 10Output: 6Description: 2 = 2 3 = 3 4 = 2 * 2 6 = 2 * 3 8 = 2…
Given a string of size N and an integer K, the task is to generate a string whose substrings of size K can be concatenated into a given string. Example: Input: str=”abbaaa” K=2Output: abaaDescription:All child strings of the parent string “abaa” of size 2 are “ab”, “ba” and “aa”. Once all of these substrings are concatenated, you can…
For a given n> 0, find different ways to write n to the sum of two or more positive integers. Example: This problem can be solved by the coin change problem, except that in this case, we should iterate 1 to n-1 instead of repeating a specific coin value like the coin change problem. C/C++…
Given a string str. The string may contain lowercase letters, special characters, numbers or even spaces. The task is to check if only the letters present in the string form a palindrome combination, without using any extra spaces. Note: No extra space is allowed to resolve this issue. In addition, the letters present in the string are all lowercase, and the…
An array list represents an ordered collection of objects that can be indexed individually. It’s basically an alternative to arrays. It also allows to dynamically allocate memory, add, search and sort items in the list. ArrayList. The RemoveRange(Int32, Int32) method is used to remove a series of elements from the ArrayList. Properties of the ArrayList class: The…
isset() function The isset() function is a built-in function in PHP that checks if a variable is set and that the variable is not NULL. This function also checks if the declared variable, array, or array key has a null value, and if it exists, isset() returns false, and true in all other possible cases. The syntax is as follows:…
This section describes how to deploy NGINX reverse proxy in Docker Reverse proxies intercept incoming requests and direct them to the appropriate server. This not only improves performance but also enhances the security of the server. The easiest way to set up and manage a reverse proxy is to use Nginx and Docker. This guide…
How does python read xlsx files?The .xlsx is able to store large amounts of data in tabular form, and many types of arithmetic and logical calculations can be easily extended in Excel spreadsheets. Sometimes for programming purposes, it is necessary to read data from an excel document using a Python script. How does python read excel files?There are…