Detail Form
We will send your result on your email id and phone no. please fill detail
Trie is an efficient information retrieval data structure. Use this data structure to store Strings and search strings. Your task is to use TRIE data structure and search the given string A. If found print 1 else 0.
Example 1:
Example 2:
Your Task:
Complete insert and search function and return true if key is present in the formed trie else false in the search function. (In case of true, 1 is printed and false, 0 is printed by the driver's code.
Expected Time Complexity: O(M+|search|).
Expected Auxiliary Space: O(M).
M = sum of the length of all strings which is present in the key[]
|search| denotes the length of the string search.
Constraints:
1 <= N <= 104
1 <= |input strings|, |A| <= 100
Given a binary matrix your task is to find all unique rows of the given matrix.
Example 1:
Your Task:
You only need to implement the given function uniqueRow(). The function takes three arguments the first argument is a matrix M and the next two arguments are row and col denoting the rows and columns of the matrix. The function should return the list of the unique row of the martrix. Do not read input, instead use the arguments given in the function.
Note: The drivers code print the rows "$" separated.
Expected Time Complexity: O(row * col)
Expected Auxiliary Space: O(row * col)
Constraints:
1<=row,col<=40
0<=M[][]<=1
Given an array of integers of size N find minimum xor of any 2 elements.
Example 1:
Your Task:
You don't need to read input or print anything. Your task is to complete the function minxorpair() which takes the array arr[], its size N as input parameters and returns the minimum value of xor of any 2 elements.
Expected Time Complexity: O(N)
Expected Auxiliary Space: O(N)
Constraints:
1 <= N <= 105
1 <= arr[i] <= 105