Category: hackerrank

Day 2: Operators

                 Day 2: Operators Objective In this challenge, you'll work with arithmetic operators. Check out the Tutorial tab for learning materials and an instructional video! Task Given the meal price (base cost of a meal), tip percent (the percentage of the meal price being added as tip),) and tax percent (the percentage of the meal price being added as tax)

Day 3: Intro to Conditional Statements

Day 3: Intro to Conditional Statements   Objective In this challenge, we're getting started with conditional statements. Check out the Tutorial tab for learning materials and an instructional video! Task Given an integer, , perform the following conditional actions: If  is odd, print Weird If  is even and in the inclusive range of  to , print Not Weird If  is even and in the inclusive

Day 1: Data Types

                Day 1: Data Types   Objective Today, we're discussing data types. Check out the Tutorial tab for learning materials and an instructional video! Task Complete the code in the editor below. The variables i,d , and s are already declared and initialized for you. You must: Declare 3 variables:

Super Reduced String

Super Reduced String Steve has a string, , consisting of  lowercase English alphabetic letters. In one operation, he can delete any pair of adjacent letters with same value. For example, string “aabcc” would become either “aab” or “bcc” after operation. Steve wants to reduce  as much as possible. To do this, he will repeat the above operation as many times as

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