Month: June 2017

Decode Ways – Secret Message [ZOHO]

                      Decode Ways - Secret Message A top secret message string S containing letters from A-Z (only upper case letters) is encoded to numbers using the following mapping: 'A' -> 1, 'B' -> 2 and so on till Z -> '26'The program has to print

Print Numbers – Frequency Based

     Print Numbers – Frequency Based  An array of N positive integers is passed as input. The program must print the numbers in the array based on the frequency of their occurrence. The highest frequency numbers appear first in the output.Note: If two numbers have the same frequency of occurrence (repetition) print the smaller

Anagrams Count (Id-396)

                                               Anagrams Count (Id-396)  Two strings S1, S2 are passed as input to the program. The program must print the count of anagrams present in both the strings.Out of each pair of words in

Expand Character Based on Occurence

Expand Character Based on Occurence                                                       A string consisting of short hand form of occurrence of alphabets will be passed as input. The program must expand the code and print the

Average Population | SQL – HackerRank

                                               Given the CITY and COUNTRY tables, query the names of all the continents (COUNTRY.Continent) and their respective average city populations (CITY.Population) rounded down to the nearest integer. Note: CITY.CountryCode and COUNTRY.Code are matching key columns. Do not include continents without cities in

African Cities | SQL:- Hackerrank

                                         Given the CITY and COUNTRY tables, query the names of all cities where the CONTINENT is 'Africa'. Note: CITY.CountryCode and COUNTRY.Code are matching key columns. Input Format The CITY and COUNTRY tables are described as follows: Query: select city.name. from city INNER JOIN country ON city.countrycode=country.code where continent='Africa';

Asian Population | SQL

                                            Given the CITY and COUNTRY tables, query the sum of the populations of all cities where the CONTINENT is 'Asia'. Note: CITY.CountryCode and COUNTRY.Code are matching key columns. Input Format The CITY and COUNTRY tables are described as follows: Query: select sum(City.POPULATION) from Country INNER JOIN CITY ON

Left Rotation | Data structures

                                                Left Rotation  A left rotation operation on an array of size  shifts each of the array’s elements  unit to the left. For example, if  left rotations are performed on array , then the array would become . Given an

Sum of N Integers – Even Reversed

                     Sum of N Integers - Even Reversed                                      The program must accept N integers and print the sum S of all POSITIVE integers with the even positive integers reversed.

Simple Calculator Command

         Simple Calculator Command                                     A string S is passed as input. S will contain two integer values separated by one of these alphabets - A, S, M, D where- A or a is for addition-