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 are given a list of n-1 integers and these integers are in the range of 1 to n. | |
| There are no duplicates in list. One of the integers is missing in the list. | |
| Write an efficient code to find the missing integer. | |
| */ | |
| const findMissing = (nums) => { | |
| let n; |
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
| // Assuming that someone dictates you a sequence of numbers and you need to write it down. | |
| // For brevity, he dictates it as follows: first says the number of consecutive identical numbers and then | |
| // says the number itself. E.g. The sequence 1 1 3 3 3 2 2 2 2 14 14 14 11 11 11 2 will be dictated as | |
| // "Two times one, three times three, four times two, three times fourteen, three times eleven, one time two", | |
| // so you will write down the sequence 2 1 3 3 4 2 3 14 3 11 1 2. | |
| // Compresses a given sequence using this approach | |
| const compressSequence = seq => { | |
| let counter = 1; | |
| let result = ""; |
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
| /* Write a program to read a multiple line text file and write the 'N' longest lines to stdout. Where the file to be read is specified on the command line. | |
| Input sample: | |
| Your program should read an input file (the first argument to your program). The first line contains the value of the number 'N' followed by multiple lines. You may assume that the input file is formatted correctly and the number on the first line i.e. 'N' is a valid positive integer.e.g. | |
| 2 | |
| Hello World | |
| CodeEval | |
| Quick Fox |
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
| sudo /Applications/Install\ OS\ X\ El\ Capitan.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ El\ Capitan.app --nointeraction |
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
| - Download the image to your computer: https://www.raspberrypi.org/downloads/ | |
| - Use Etcher to brun the ISO to your sd card: https://etcher.io/ | |
| - Create a `wpa_supplicant.conf` file: | |
| `sudo nano /etc/wpa_supplicant/wpa_supplicant.conf` | |
| - add the following to the `wpa_supplicant.conf` | |
| ``` | |
| network={ | |
| ssid="YOUR SSID" | |
| psk="YOUR PASSWORD" | |
| } |
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
| #node | |
| curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - | |
| sudo apt-get install -y nodejs | |
| #git | |
| sudo apt-get install git |