How to find if the number is a Perfect Square
Compute and generate a compressed string for a given string containing repetitions
For a given string return a compressed string which replaces all the repetitions of the characters with their counts. If the compressed string is not smaller than the initial string return the original string as it is. For example, if the input string is "aabbbbbcccdddeef", then the resultant string should be "a2b5c3d3e2f1", whereas if the input string is "abcdef" then the output should be "abcdef".
Find all possible natural numbers below a given limit such that a3+b3 = c3+d3
Imagine you are given a number n. You need to find out all possible sets of numbers that fit into a,b,c,d such that a3+b3=c3+d3. There is no restriction that the numbers a,b,c,d need to be distinct.
Find all the pairs in a given ordered set of numbers whose sum is equal to a given input sum
In this problem, we will be given a sorted set of numbers and a number, we need to print all the pairs available in the set whose sum is equal to the given number. For example, if we are given a set of numbers [1,2,5,6,7, 9,11,48,64, 84] and the sum is 8 - the output should be 1,7 2,6 since these are the only "pairs" of numbers which produce the given sum 8 among the numbers in the set.
Find all the pairs in a given unordered set of numbers whose sum is equal to a given input sum
In this problem, we will be given an unordered set of numbers and a number, we need to print all the pairs available in the set whose sum is equal to the given number. For example, if we are given a set of numbers [1, 2, 4, 8, 11, 9, 23, 5, 5, 6] and the sum is 10 - the output should be 8,2 9,1 5,5 6,4 since these are the only "pairs" of numbers which produce the given sum 10 among the numbers in the set.
Sort the given unordered set of Binary digits
In this problem, we shall be given an unordered set of binary digits (0s and 1s) and we are expected to sort all the digits into ascending order. For example, If the given array of digits are [1,0,1,1,0,0,1,1,1,1] the output should be [0,0,0,1,1,1,1,1,1,1].
Find the count of occurrences of all the words in a given sentence
Let's say we have a given sentence consisting of more than one repeating words, we need to print all the distinct words present in the sentence and how many times each word is repeated inside the sentence.
Find the number of occurrences of a given character in a string
For a specified string, we would need to find out how many times an input character occurs in the string. For example, in a string "amigo baltigo jijutsu" the character i occurs 3 times. We would need to print the count for every input of a string and a character.