This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string = "Denver" | |
puts "#{string[0]}#{string.length - 2}#{string[-1]}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
age = 5 | |
puts "#{('happy ' * age).capitalize}birthday!" |
Input Format
You are given an integer N depicting the height of the staircase.
Output Format
Print a staircase of height N that consists of # symbols and spaces as given in Sample Output.
Sample Input
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You have an array of integers, and for each index you want to find the product of every integer except the integer at that index. | |
Write a function get_products_of_all_ints_except_at_index() that takes an array of integers and returns an array of the products. | |
For example, given: | |
[1, 7, 3, 4] | |
your function would return: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Suppose we could access yesterday's stock prices as an array, where: | |
The indices are the time in minutes past trade opening time, which was 9:30am local time. | |
The values are the price in dollars of Apple stock at that time. | |
So if the stock cost $500 at 10:30am, stock_prices_yesterday[60] = 500. | |
Write an efficient function that takes stock_prices_yesterday and returns the best profit I could have made from 1 purchase and 1 sale of 1 Apple stock yesterday. | |
For example: |
You are to create a Pig Latin Translator that has a REPL that follows an interaction model similar to this.
Pig Latin takes the first consonant (or consonant cluster) of an English word, moves it to the end of the word and suffixes an ay, or if a word begins with a vowel you just add way to the end. For example, pig becomes ig-pay, banana becomes anana-bay, and aadvark becomes aadvark-way.
> cat
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Use black tool to open battery compartment. | |
* Put battery in. Plus side up. | |
* Plug ANT+ Dongle into computer. | |
* Go to fitbit.com/start | |
* Download Mac App | |
* Install Fitbit Connect | |
* Application will update on its own. | |
* Sign up for account, you can use Google or Facebook. | |
* Enter personal data. | |
* Select Fitbit Zip. |