Skip to content

Instantly share code, notes, and snippets.

View akaila's full-sized avatar

Ashish Kaila akaila

View GitHub Profile
// Print the nodes of binary tree column wise
/*
Input:
8
/ \
6 10
/ \ / \
4 7 9 12
//http://www.glassdoor.com/Interview/Given-a-large-input-string-write-a-function-to-check-if-it-is-a-palindrome-according-to-the-following-restrictions-low-QTN_927605.htm
//Given a large input string, write a function to check if it is a palindrome,
//according to the following restrictions: -lowercase and uppercase characters are considered equal -special characters are ignored
var aCode = "a".charCodeAt(0);
var ACode = "A".charCodeAt(0);
var setLen = 26;
function isChar(char) {
@akaila
akaila / findSubarraySum.js
Last active October 14, 2015 16:15
Given an array of positive integers and a target integer, find if there is a consecutive subarray that sums to the target. E.g, given {5,6,4,12}, findsum(10)=true, findsum(11)=false.
/*
Given an array of positive integers and a target integer, find if there is a consecutive subarray that sums to the target.
E.g, given {5,6,4,12}, findsum(10)=true, findsum(11)=false.
http://www.glassdoor.com/Interview/Given-an-array-of-positive-integers-and-a-target-integer-find-if-there-is-a-consecutive-subarray-that-sums-to-the-target-QTN_984284.htm
*/
function findSubarraySum(numbers, sum) {
var sumSoFar = 0;
var start = 0;
var end = 0;
//React/Views/RCTViewSnapshotManager.h
//
// RCTViewSnapshot.h
// React
//
// Created by Kaila, Ashish on 7/30/15.
// Copyright (c) 2015 Facebook. All rights reserved.
//
#import "RCTViewManager.h"