IACS Computes! High School summer camp
Day 1
Day 2
Day 3
Day 4
Day 5
Day 6
Day 7
Day 8
Day 9
Disclaimer: problems 2
, 3
are taken from https://www.hackerrank.com/. Problem 4
is just slightly inspired by it. :)
Here, we are given a list of programming languages used in different projects. There are repetitions, of course – same language might have been used somewhere else! Our task is to analyze the list and print the following information:
For example:
Python and Java are the most popular languages for those projects.
Lisp is the least popular one.
Julius Caesar protected his confidential information by encrypting it using a cipher. Caesar’s cipher shifts each letter by a number of letters. If the shift takes you past the end of the alphabet, just rotate back to the front of the alphabet. In the case of a rotation by 3, w
, x
, y
and z
would map to z
, a
, b
and c
.
abcdefghijklmnopqrstuvwxyz
defghijklmnopqrstuvwxyzabc
For example, given the rotation by 3:
python
sbwkrq
Write a function that decyphers the encoded words. Start by creating a dictionary that gives a correspondence of original vs. encoded letters.
Here, our task is to count the number of words in the input string. Alice wrote a sequence of words in CamelCase as a string of letters that has the following properties:
For example, helloThere
and helloBeautifulWorld
are camel case, but HelloThere
or hellothere
are not. Your task is to write a function to count the number of words in the camel case string.
This problem will have two parts. First, we will ask input from the user in order to fill the phonebook. Second, we will write a look-up function in order to retrieve the needed phone numbers.
Create a dictionary and save phone numbers in it. Keep asking user for the input until they print stop
.
Now that you have a dictionary, write a function that takes that dictionary and a name as input, and returns the corresponding phone number. Handle the case if the phone number is not found in the dictionary.