Squashing is a process in which we squeeze multiple commits into one pretending it is only a single commit.
Basically squashing commits means we are rewriting the history of commits to make them look like single commit.
To open a terminal, use `M-x ansi-term` | |
In ansi-term: | |
To switch to line-mode, and treat the terminal as a regular buffer, use `C-x C-j`. | |
If you want to switch back to char-mode (where you can't delete the prompt), `C-x C-k`. | |
To open a file: `C-x C-f`, and if the file doesn't exist, it'll be created. | |
To make a directory, use `mkdir` in the terminal, or use `M-x make-directory`. | |
To hide all other visible buffers, use `C-x 1`. | |
`C-x 2` creates a horizontal split, and `C-x 3` creates a vertical split. |
import java.util.*; | |
import java.lang.*; | |
public class Solution { | |
public boolean canFinish(int numCourses, int[][] prerequisites) { | |
return !hasCycle(numCourses, prerequisites); | |
} | |
private boolean hasCycle(int numCourses, int[][] prerequisites) { | |
List<Integer>[] g = constructGraph(numCourses, prerequisites); |
I hereby claim:
To claim this, I am signing this object:
(* ctci 11.2: Write a method to sort an array of strings so that all the | |
* anagrams are next to each other. *) | |
let group_anagrams (xs : string array) : unit = | |
let join (xs : char array) : string = | |
String.concat_array (Array.map ~f:Char.to_string xs) in | |
let key (s : string) : string = | |
let chars = String.to_array s in | |
Array.sort chars ~cmp:Char.compare; | |
join chars in |
Bryan (BGMetarex) vs Jansen (berryhilljansen) http://warlight.net/MultiPlayer?GameID=3610813 Winner: Jansen
Beg. Tier
open Printf | |
let fetch_ints (size : int) : int array = | |
Array.init size (fun x -> read_int()) | |
let insertion_sort = | |
let size = read_int() in | |
let sizep = pred size | |
and arr = fetch_ints size in | |
let x = arr.(sizep) in |
module FilterElems where | |
import Data.List | |
import Control.Monad | |
-- abstract tuple comparison | |
sortTup f = | |
case ord of | |
EQ -> snd f | |
_ -> ord | |
where ord = fst f |
import Control.Monad (liftM2) | |
import Data.List (tails) | |
import Data.Maybe (fromMaybe, mapMaybe) | |
import Safe.Foldable (maximumMay) | |
prices = [10, 30, 42, 15, 20, 50, 10, 25] | |
profit :: [Integer] -> Integer | |
profit = fromMaybe 0 . maximumMay . mapMaybe (uncurry (liftM2 (-))) . large |
#lang racket | |
(require racket/match) | |
;; initial-state :: State | |
;; State = (Missionaries on left, Cannibals on left, Boat on left?) | |
(define initial-state '(3 3 #t)) | |
;; goal-state :: State | |
(define goal-state '(0 0 #f)) |