Skip to content

Instantly share code, notes, and snippets.

View jjst's full-sized avatar
🐱

Jérémie Jost jjst

🐱
View GitHub Profile
module Main exposing (main)
import Html exposing (Html)
-- MODEL
type alias Model =
List Bool
@jjst
jjst / Solution.java
Last active September 8, 2017 14:10
Euler 8
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
public class Solution {
static String rawString = "73167176531330624919225119674426574742355349194934\n" +
"96983520312774506326239578318016984801869478851843\n" +
"85861560789112949495459501737958331952853208805511\n" +
"12540698747158523863050715693290963295227443043557\n" +
@jjst
jjst / Main.elm
Created April 27, 2017 19:21
katas-elm-taxicab
module Main exposing (..)
import String
import Html exposing (text)
type Turn
= L
| R
| Stay
@jjst
jjst / keybase.md
Created February 13, 2017 20:09
Keybase

Keybase proof

I hereby claim:

  • I am jjst on github.
  • I am jjst (https://keybase.io/jjst) on keybase.
  • I have a public key ASB_mVhGrGeoqucZVHdDPclapEOSaJ9k7ved2NtHPL4BKQo

To claim this, I am signing this object:

@jjst
jjst / DojoGolf.hs
Last active July 13, 2016 22:48
Euler 8 code dojo
import Data.List
import Data.Char
input = "73167176531330624919225119674426574742355349194934\
\96983520312774506326239578318016984801869478851843\
\85861560789112949495459501737958331952853208805511\
\12540698747158523863050715693290963295227443043557\
\66896648950445244523161731856403098711121722383113\
\62229893423380308135336276614282806444486645238749\
\30358907296290491560440772390713810515859307960866\
@jjst
jjst / dojogolf.py
Created July 13, 2016 14:27
dojo-golf-euler8
s = """
73167176531330624919225119674426574742355349194934
96983520312774506326239578318016984801869478851843
85861560789112949495459501737958331952853208805511
12540698747158523863050715693290963295227443043557
66896648950445244523161731856403098711121722383113
62229893423380308135336276614282806444486645238749
30358907296290491560440772390713810515859307960866
70172427121883998797908792274921901699720888093776
65727333001053367881220235421809751254540594752243
@jjst
jjst / ipython.md
Last active July 17, 2021 00:13
ipython install & cheat sheet

Getting started

Install

pip install ipython

If you also wanna use the notebook:

# Solution for https://www.hackerrank.com/challenges/game-of-throne-ii
from collections import Counter
from math import factorial as f
word = raw_input()
letter_count = [i/2 for i in Counter(word).values()]
print (f(sum(letter_count)) / (reduce(lambda acc, x: acc * f(x), letter_count, 1))) % (10**9 + 7)
@jjst
jjst / LispParser.scala
Created April 4, 2016 19:03
A LISP parser
trait ASTElement
case class Expression(elements: ASTElement*) extends ASTElement
case class Literal[T](value: T) extends ASTElement
case class Function(name: String) extends ASTElement
object LispParser {
def main(args: Array[String]) {
val ast = parse("(first (list 1 (+ 2 3) 9))")
assert(ast ==
/**
* Created by jjst on 21/03/16.
*/
object Floors {
def main(args: Array[String]): Unit = {
Console.println(floorNumber1("())"))
Console.println(floorNumber2("())"))
Console.println(floorNumber2(""))
}