This file contains 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
/** | |
* Created by rohansingh on 6/20/17. | |
*/ | |
public class MaxProfit{ | |
public static void main(String[] args) { | |
/** | |
*The following array shows the price of a stock on the i-th day | |
* and serves an input to the maxProfit Method | |
*/ |
This file contains 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
# 0 is too far from ` ;) | |
set -g base-index 1 | |
# Automatically set window title | |
set-window-option -g automatic-rename on | |
set-option -g set-titles on | |
#set -g default-terminal screen-256color | |
set -g status-keys vi | |
set -g history-limit 10000 |
This file contains 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
#include <iostream> // std::cout | |
#include <string> // std::string | |
int main () | |
{ | |
std::string str ("There are two needles in this haystack with needles."); | |
std::string str2 ("needle"); | |
// different member versions of find in the same order as above: | |
std::size_t found = str.find(str2); |
This file contains 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
""" | |
Amaze - A completely object-oriented Pythonic maze generator/solver. | |
This can generate random mazes and solve them. It should be | |
able to solve any kind of maze and inform you in case a maze is | |
unsolveable. | |
This uses a very simple representation of a mze. A maze is | |
represented as an mxn matrix with each point value being either | |
0 or 1. Points with value 0 represent paths and those with | |
value 1 represent blocks. The problem is to find a path from |
This file contains 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |