The classification of a security risk into "diversifiable" and "non-diversifiable" risks has come up from the portfolio approach of capital investment. It has culminated in the well-known and popular Capital Asset Pricing Model (CAPM), developed by Sharpe, Lintner, and others. According to this framework, the "diversifiable risk" is the risk that can be eliminated by diversification, while "non-diversifiable risks" are the risks that cannot be diversified away. Many investors define the two types of risks as two complementary components of the standard deviation (SD) of a security's rate of return.Diversifiable RiskDiversifiable risk is also called as "unsystematic risk". These risks ... Read More
Suppose we have an array called points with some points in the form (x, y). Now the cost of connecting two points (xi, yi) and (xj, yj) is the Manhattan distance between them, the formula is |xi - xj| + |yi - yj|. We have to find the minimum cost to make all points connected.So, if the input is like points = [(0, 0), (3, 3), (2, 10), (6, 3), (8, 0)], then the output will be 22 becauseso here total distance is (6+5+3+8) = 22.To solve this, we will follow these steps −points_set := a new set holding numbers ... Read More
Suppose we have a list of preferences for n(even) different friends. For each person i, the preferences[i] holds a list of friends sorted in the order of preference. So, a friend earlier in the list is more preferred than a friend later in the list. The friends in each list are numbered by integers from 0 to n-1. All of the friends are divided into different pairs. where pairs[i] = [xi, yi] represents xi is paired with yi and/or yi is paired with xi. But a friend x is unhappy if x is paired with y and there exists a ... Read More
If you create a contract and then file for bankruptcy, then the lender or creditor can file a "contingent claim" against your estate. A contingent claim that is based on some future event can be dealt with by the court in a number of ways.Certain Conditions Must be MetFor the contingent claim to file, some certain events must have taken place in the preceding phases. Because the future event is not guaranteed to happen or the creditors cannot say with 100% condition that the bankruptcy will take place, the claim may or may not become valid.Contingent claims are usually filed ... Read More
Options are "derivative investments", meaning the price movements of the investments are based on the price movements of another financial product. The financial product from which the derivative is obtained is called the "underlying."Call and Put OptionsOptions are contracts that provide the buyer the right to buy or sell an underlying asset, at a predetermined price and before a specific date.A call option is bought by a trader if the investor expects the price of the underlying to rise within a certain time frame.A put option is bought by a trader if he/she expects the price of the underlying to ... Read More
Suppose we have a string s and another array of integers called cost where cost[i] represents the cost of deleting the ith character in s. We have to find the minimum cost of deletions such that there are no two same letters next to each other. We have to keep in mind that that we will delete the chosen characters at the same time. So after deleting a character, the costs of deleting other characters will not change.So, if the input is like s = "pptpp", cost = [2, 3, 4, 5, 2], then the output will be 4 because ... Read More
Suppose we have two arrays nums1 and nums2, we have to find of triplets formed (type 1 and type 2) following these two rules −Triplet (i, j, k) if nums1[i]^2 = nums2[j] * nums2[k] where [0
What is a Strike Price?In the case of an option contract, the "strike price" is the predetermined and agreed-upon price at which a specific security may be bought (by the call option holder) or sold (by the put option holder) until or upon the expiration of the contract. The term "strike price" is also termed as "exercise price."Options are derivatives that offer their buyers a right, or an option—but not an obligation—to buy or sell a security, such as a stock at a specific price (or the strike price) until or on a certain date (the expiration date).Buying or selling ... Read More
Suppose we have an array called arr, we have to remove a subarray of arr such that the remaining elements in arr are in non-decreasing order. We have to find the length of the shortest subarray to remove.So, if the input is like arr = [10, 20, 30, 100, 40, 20, 30, 50], then the output will be 3 because we can remove [100, 40, 20] which is smallest subarray of length 3, and by removing these all are in non-decreasing order [10, 20, 30, 30, 50].To solve this, we will follow these steps:n := size of arrarr := insert ... Read More
Suppose we have a binary string s we can split s into 3 non-empty strings s1, s2, s3 such that (s1 concatenate s2 concatenate s3 = s). We have to find the number of ways s can be split such that the number of characters '1' is the same in s1, s2, and s3. The answer may be very large so return answer mod 10^9+7.So, if the input is like s = "11101011", then the output will be 2 because we can split them like "11 | 1010 | 11" and "11 | 101 | 011".To solve this, we will ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP