Skip to content

Instantly share code, notes, and snippets.

/**
* 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
*/
@rhn89
rhn89 / tmux.conf
Created July 11, 2016 22:25 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 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
@rhn89
rhn89 / find_string.cpp
Created April 4, 2016 05:09
string::find function
#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);
"""
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
@rhn89
rhn89 / 0_reuse_code.js
Created January 16, 2016 08:51
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console