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
| /** | |
| Given a string, remove any characters that are unique from the string. | |
| Example: | |
| input: "abccdefee" | |
| output: "cceee" | |
| */ |
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
| // create all permutations of an input string and remove duplicates, if present | |
| function permutations(string) { | |
| var nums = Array.from(string); | |
| var permutations = []; | |
| function swap(a, b) { | |
| var tmp = nums[a]; | |
| nums[a] = nums[b]; |
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
| function order(words){ | |
| /** | |
| * Your task is to sort a given string. | |
| * Each word in the string will contain a single number. | |
| * This number is the position the word should have in the result. | |
| * Note: Numbers can be from 1 to 9. So 1 will be the first word (not 0). | |
| * If the input string is empty, return an empty string. The words in the input String will only contain valid consecutive numbers. | |
| * |
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
| function humanReadable(seconds) { | |
| var readable = ["00", "00", "00"]; | |
| // TODO | |
| if (seconds > 359999 || seconds < 0) { | |
| console.log("exiting...") | |
| return; | |
| } | |
| var min = 60; //* 60 = 1 hour | |
| var hour = 3600; //* 24 = 1 day | |
| var day = 86400; // |
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
| --- | |
| AWSTemplateFormatVersion: '2010-09-09' | |
| Resources: | |
| myDynamoDBTable: | |
| Type: AWS::DynamoDB::Table | |
| Properties: | |
| AttributeDefinitions: | |
| - AttributeName: Album | |
| AttributeType: S | |
| - AttributeName: Artist |
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
| #!/bin/bash | |
| yum update -y | |
| yum install -y httpd24 php56 | |
| cd /home/ec2-user/ | |
| aws s3 cp 's3://aws-codedeploy-us-west-2/latest/codedeploy-agent.noarch.rpm' . --region us-west-2 | |
| yum -y install codedeploy-agent.noarch.rpm | |
| chown -R root:www /var/www | |
| chmod 2775 /var/www |
NewerOlder