Skip to content

Instantly share code, notes, and snippets.

View seemaullal's full-sized avatar

Seema Ullal seemaullal

  • United States
  • 07:52 (UTC -07:00)
View GitHub Profile
@seemaullal
seemaullal / gist:dc9b81f8ee45cfa7eb83
Last active August 29, 2015 14:24
Algorithms 7/16

Level 1
Create a function called removeVowels() to remove all the vowels in a given string. Both uppercase and lowercase vowels should be removed. Your input will be a string and you should return the string without any vowels.

Level 2
Write a function that takes in a 2-D array that represents a square matrix and returns the product of the diagonal of the matrix. For example [ [ 2, 3], [ 4, 5] ] will return 10 (2x5).

Level 3

@seemaullal
seemaullal / gist:3f5ef89bd9e62fbafaa5
Last active July 27, 2017 03:03
Async Library Notes

Some Useful Async library methods

async.each

async.each(arr, function(item,callback) {
	
},
function(err) { 
//function code that is to be done after the 2nd 
//argument of async.each is called on each element
@seemaullal
seemaullal / gist:04e7ea028e3c4acab8ad
Created April 27, 2015 20:16
Breadth First Search (for binary trees)
Note: This example is for a binary tree but for graphs, you do a similar thing but need to keep track of which nodes you have visited (until you visit all of them) and also add all children to the queue, not just the left and right child.
Tree:
5
/ \
2 6
/ \ / \
1 3 4 7
Add the root to the BFSArray (the results). Add its children to the queue.
@seemaullal
seemaullal / CoDuels
Created March 17, 2015 22:33
CoDuels
### Core Features ###
- Log in
- Screen cast of what you can do (demo) for about page
- Live feed of open "battles" (___ & ___ are battling on ___ challenge).
- Panel? Github sign in, Google plus, twitter, other ??
- Profile page
- Random challenge plus challenge specific user
- Can pick any challenge (grouped by easy, medium, hard)
- Leader board on challenge page of "top scores" (?) from users who have done the challenge
- Let users comment/rate other peoples code (maybe)