Skip to content

Instantly share code, notes, and snippets.

View tparveen's full-sized avatar

Tauhida Parveen tparveen

View GitHub Profile
/*
### 1. URLify a string
A common mistake users make when they type in an URL is to put spaces between words or letters. One solution that developers can use to solve this problem is to replace any spaces with a '%20'. Write a method that takes in a string and replaces all its empty spaces with a '%20'. Your algorithm can only make 1 pass through the string.
Examples of input and output for this problem can be
Input: tauhida parveen
Output: tauhida%20parveen
input: www.thinkful.com /tauh ida parv een

Exercises

Palindromes

A palindrome is a word, phrase, or number that is spelled the same forward and backward. For example, “dad” is a palindrome; “A man, a plan, a canal: Panama” is a palindrome if you take out the spaces and ignore the punctuation; and 1,001 is a numeric palindrome. We can use a stack to determine whether or not a given string is a palindrome.

Write a function that takes a string of letters and returns true or false to determine whether it is palindromic. For example:

function is_palindrome(s) {
 s = s.toLowerCase().replace(/[^a-zA-Z0-9]/g, "");
@tparveen
tparveen / cicd.md
Created February 24, 2018 23:18 — forked from cklanac/cicd-config-clicker.md
CICD Travis CI and Heroku: (CLI-only and normal versions)

CICD Travis and Heroku

Setup Continuous Integration with Travis CI

Install Travis CLI

Install Travis CI's CLI: