Categories

## HackerRank – 30 Days of Code – Day 8: Dictionaries and Maps – Ruby Program

Objective Today, we’re learning about Key-Value pair mappings using a Map or Dictionary data structure. Check out the Tutorial tab for learning materials and an instructional video! Task Given n names and phone numbers, assemble a phone book that maps friends’ names to their respective phone numbers. You will then be given an unknown number […]

Categories

## HackerRank – 30 Days of Code – Day 7: Arrays – Ruby Program

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). […]

Categories

## HackerRank – 30 Days of Code – Day 6: Let’s Review – Ruby Program

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 N that is indexed from 0 to N-1, print its even-indexed and odd-indexed characters as 2 space-separated strings […]

Categories

## HackerRank – 30 Days of Code – Day 5: Loops – Ruby Program

Objective In this challenge, we’re going to use loops to help us do some simple math. Check out the Tutorial tab to learn more. Task Given an integer, n, print its first 10 multiples. Each multiple n x i (where 1<=i<=10) should be printed on a new line in the form: n x i = […]

Categories

## HackerRank – 30 Days of Code – Day 4: Class vs. Instance – Ruby Program

Objective In this challenge, we’re going to learn about the difference between a class and an instance; because this is an Object Oriented concept, it’s only enabled in certain languages. Check out the Tutorial tab for learning materials and an instructional video! Task Write a Person class with an instance variable, age, and a constructor […]