Skip to content

Instantly share code, notes, and snippets.

View VegaFromLyra's full-sized avatar

Asha Balasubramaniam VegaFromLyra

View GitHub Profile

Keybase proof

I hereby claim:

  • I am vegafromlyra on github.
  • I am ashab (https://keybase.io/ashab) on keybase.
  • I have a public key ASC5W47Oo1fzhvV8rzk4ARCg9IIoBhGp7NdXBEVVJJLdvgo

To claim this, I am signing this object:

@VegaFromLyra
VegaFromLyra / fizz_buzz.rb
Created November 6, 2016 00:32
Fizz Buzz Test
puts "Enter range for fizz buzz"
n = gets
n = n.to_i
def print_fizz_buzz(n)
range = Array(1..n)
range.each { |number| puts fizz_buzz(number) }
end
def fizz_buzz(number)
@VegaFromLyra
VegaFromLyra / top_n_words.rb
Created October 18, 2016 21:18
Top N words
puts "Enter sentence"
sentence = gets.chomp
puts "You entered '#{sentence}'"
puts "How many top words would you like to see?"
n = gets.chomp.to_i
puts "Alright, let me get that for you.."
words = sentence.split
@VegaFromLyra
VegaFromLyra / traingle.cs
Last active October 3, 2015 18:48
Triangle
using System;
using System.IO;
// NOTE: Incorrect solution
// Triangle
// By starting at the top of the triangle and moving to adjacent numbers on the row below, the maximum total from top to bottom is 27.
// 5
// 9 6
// 4 6 8
using System;
using System.Text;
using System.Collections.Generic;
// A collection of particles is contained in a linear chamber. They all have the same speed, but some are headed toward the right and others are headed toward the left. These particles can pass through each other without disturbing the motion of the particles, so all the particles will leave the chamber relatively quickly.
// You will be given the initial conditions by a String init containing at each position an 'L' for a leftward moving particle, an 'R' for a rightward moving particle, or a '.' for an empty location. init shows all the positions in the chamber. Initially, no location in the chamber contains two particles passing through each other.
// We would like an animation of the process. At each unit of time, we want a string showing occupied locations with an 'X' and unoccupied locations with a '.'. Create a class Animation that contains a method animate that is given an int speed and a String init giving the initial conditions.
@VegaFromLyra
VegaFromLyra / commonMinimum.cs
Last active August 29, 2015 14:25
Common minimum
using System;
using System.Collections.Generic;
using System.Linq;
/*
Common-minimum problem:
Write a function:
int solution(int A[], int B[]);
@VegaFromLyra
VegaFromLyra / convertToWords
Created July 19, 2015 17:44
Numbers to words
using System;
using System.Collections.Generic;
using System.Text;
// Convert a number to its english form
// 123 -> One hundred twenty three
// 123456 - > One hundred twenty three thousand four hundred fifty six
// 1234567 - > One million two hundred thirty four thousand five hundred sixty seven
// 12345678 -> twelve million three hundred forty five thousand six hundred seventy eight
// 123456789 -> one hundred twenty three million four hundred fifty six thousand seven hundred eighty nine
@VegaFromLyra
VegaFromLyra / Package.json
Last active August 29, 2015 14:25
Package.json
{
"name": "contentPortal",
"description": "Portal to manage content, contracts and sales",
"version": "1.0.0",
"repository": {
"type": "git",
"url": "https://playport.visualstudio.com/DefaultCollection/_git/ContentPortal"
},
"devDependencies": {
"grunt": "^0.4.5",
This file has been truncated, but you can view the full file.
62031 info installOne [email protected]
62032 info installOne [email protected]
62033 info installOne [email protected]
62034 info installOne [email protected]
62035 info installOne [email protected]
62036 info installOne [email protected]
62037 info installOne [email protected]
62038 info installOne [email protected]
62039 silly gunzTarPerm extractEntry README.md
62040 silly gunzTarPerm modified mode [ 'README.md', 493, 511 ]
@VegaFromLyra
VegaFromLyra / cloneGraph
Created July 15, 2015 22:41
Clone a graph
using System;
using System.Collections.Generic;
// Given a graph, create a deep copy of that graph
// Time: O(e * n), e - number of edges, n - number of vertices/nodes
// Space: O(n), n is number of nodes
namespace CloneGraph
{
public class Program