Find the Second Largest Number

Objective: You are given n numbers. Store them in a list and find the second largest number. Input Format The first line contains n. The second line contains an array A[]  of n integers each separated by a space. Constraints 2 <= n<=10 -100<= A[i] <=100 Output Format Print the value of the second largest number. Sample Input 0 5 2... Continue Reading →

Day 9: Recursion

Objective Today, we're learning and practicing an algorithmic concept called Recursion. Recursive Method for Calculating Factorial factorial(N) = 1                                                N=1 factorial(N)=factorial(N-1)*N                       N>1 Task... Continue Reading →

List Comprehensions

Let's learn about list comprehensions! You are given three integers X, Y and Z representing the dimensions of a cuboid along with an integer . You have to print a list of all possible coordinates given by (i, j, k) on a 3D grid where the sum of i+j+k is not equal to N .... Continue Reading →

Day 8: Dictionaries and Maps

A dictionary is used to map or associate things you want to store with a key and a key is required to get values associated with that particular key. A dictionary in Python is just like a dictionary in the real world. Python Dictionary is defined by two elements Keys and Values. Keys will be... Continue Reading →

Day 7: Arrays

Objective Today, we're learning about the Array data structure. Check out the Tutorial tab for learning materials and an instructional video! Task Given an array, A, of N integers, print A's elements in reverse order as a single line of space-separated numbers. Input Format The first line contains an integer, N (the size of our array). The second line contains N space-separated integers describing array 's elements. Constraints 1<=... Continue Reading →

Day 6: Let’s Review. HackerRank 30 Days of Code Challenge

Objective Today we're expanding our knowledge of Strings and combining it with what we've already learned about loops. Check out the Tutorial tab for learning materials and an instructional video! Task Given a string, S, of length that is indexed from 0 to N-1, print its even-indexed and odd-indexed characters as 2 space-separated strings on a single line (see the Sample below for more detail). Note: 0 is... Continue Reading →

Day 3: Intro to Conditional Statements

If, else and elif are used to create conditional statement. As the name suggest the conditional statement are used to evaluate a condition. If a condition is evaluated to true a set of code runs else other set of code runs. Objective In this challenge, we're getting started with conditional statements. Check out the Tutorial tab for... Continue Reading →

Create a free website or blog at WordPress.com.

Up ↑