Detail Form
We will send your result on your email id and phone no. please fill detail
You are given two strings that are made of lowercase English alphabets. Find the number of different pairs such that the substrings are equal and the value of is minimum.
Input format
Output
Print the number of different pairs such that the substrings are equal and the value of is minimum.
Constraints
Given two integers m & n, find the number of possible sequences of length n such that each of the next element is greater than or equal to twice of the previous element but less than or equal to m.
Example 1:
Example 2:
Your Task:
You do not need to read input or print anything. Your task is to complete the function numberSequence() which takes the number m and n as input parameters and returns the number of sequences.
Expected Time Complexity: O(m*n)
Expected Auxiliary Space: O(1)
Constraints:
1 ≤ m, n ≤ 100
Given an integer N representing the number of pairs of parentheses, the task is to generate all combinations of well-formed(balanced) parentheses.
Example 1:
Given a set of numbers from 1 to N, each number is exactly present twice so there are N pairs. In the worst-case scenario, how many numbers X should be picked and removed from the set until we find a matching pair?
Example 1:
Example 2:
Your Task:
You don't need to read input or print anything. Your task is to complete the function find() which takes an integer N as input parameter and returns an integer, the number of x must be picked and removed from set to find a matching pair.
Expected Time Complexity: O(1)
Expected Space Complexity: O(1)
Constraints:
0 <= N <= 105
Given a positive integer n. Find the sum of product of x and y such that floor(n/x) = y .
Example 1:
Example 2:
Your Task:
You don't need to read or print anything. Your task is to cpmplete the function sumofproduct() which takes n as input parameter and returns the sum of product of all possible pairs(x, y).
Expected Time Complexity: O(n)
Expected Space Compelxity: O(1)