- The array T represents the diameters of various teacups, and the array S, the diameters of saucers, both the arrays sorted in non-decreasing order. The ith cup (whose diameter is T[i]) can be paired with the jth saucer (whose diameter is S[j]) if and only if S[j] >= T[i].
Given the sorted arrays S and T, write a program to get max number of pairs.
- Write a function that prints a 2-D (m x n) array in spiral order.
- Given a string find all the combinations of the characters from the string. Assume that input string will not contain any repetition of characters.
For eg. For string 'ABC', the possible combinations are 'A', 'B', 'C', 'AB', 'AC', 'BC' and 'ABC'
- A number is said to be circular if multiplying the number by its unit digit, gives the same number circularly shifted right by 1 position.
Example: 102564 is a circular number, since 102564 X 4 = 410256 (which is 102564 right circulated by 1 position). Implement a function to determine whether a given number is circular.
- Given a 2D array, write a program to return the reflection of the array (Mirror image of the Array).
- Write a method that prints all n digit positive numbers whose sum of digits is greater than givne 'minDigitsSum'.
For Ex. PrintNumbers(2,16) should print the following numbers ( not necessarily in the same order) : 97, 88, 79, 98, 89, 99
- Given a string and a delimiter character, implement 'Split' method, which splits the given string by delimiter character and returns an array of strings.
For Ex. Given string 'AB,CD,EF', and delimiter character as , (comma), Split method will return a string array of size 3 containing {AB, CD, EF}.
- Implement a function for re-arranging an array of size 2*N which contains elements as [A1, A2, . . . , AN, B1, B2, . . ., BN] to [A1, B1, A2, B2, . . ., AN, BN].
- Write function to print the unique partitions of n (1 to n) that are of size m.
For Ex. n=10 and m=4 it should print '7 1 1 1', '6 2 1 1', '5 3 1 1', '4 4 1 1', '5 2 2 1', '4 3 2 1', '3 3 3 1', '4 2 2 2', '3 3 2 2'
- Write a function to print the next number of the givn number, the next number should contain given set of digits.
Ex1: Given Set is (1, 3, 5, 9) and given number is 42, returned next number is 51.
Ex2: Given set is (2, 3, 4, 5, 8) and given number is 49, returned next number is 52.
|
|