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
#!/usr/bin/python | |
from sys import argv, stdin, stdout | |
import re | |
translate = { | |
'em': 'enterMove', | |
'sm': 'showMove', | |
'show': 'showBoard', | |
'am': 'applyMove', | |
'dm': 'doMove', |
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
#!/usr/bin/python | |
from sys import argv, stdin, stdout | |
import re | |
translate = { | |
'em': 'enterMove', | |
'sm': 'showMove', | |
'show': 'showBoard', | |
'am': 'applyMove', | |
'dm': 'doMove', |
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
import java.util.*; | |
class BeautifulStrings { | |
public static String solve(Scanner scan) { | |
HashMap<Character, Integer> map = new HashMap<Character, Integer>(); | |
for (char c : scan.nextLine().toLowerCase().toCharArray()) | |
if (Character.isLowerCase(c)) | |
map.put(c, (map.containsKey(c) ? map.get(c) : 0)+1); | |
List<Integer> values = new ArrayList<Integer>(map.values()); |
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
235x02:409 b235x02bw1box | |
235x07:409 b235x07bVV4RS | |
235x07:currChars: l3vZmU bestScore: 410 | |
235x08:407 b235x08cQcpgW | |
235x09:currChars: dda9QK bestScore: 409 | |
235x10:currChars: nv0kyV bestScore: 410 | |
235x11:currChars: nIFyRZ bestScore: 410 | |
235x12:405 gybe235x12aLUKDA | |
235x13:currChars: hCs4fV bestScore: 406 | |
235x13:currChars: mOy2WW bestScore: 405 |
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
Node findHead(Node start) { | |
int tortoiseSpeed = 0, hareSpeed = 0; | |
Node tortoise, hare; | |
if (start == null) | |
return start; | |
for (tortoiseSpeed = 0; true; tortoiseSpeed = hareSpeed + 1) { | |
if (start.jump(tortoiseSpeed+1) == null) | |
return null; |
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
├── S13 | |
│ ├── MagicCheck | |
│ │ ├── problem.txt | |
│ │ ├── submissions | |
│ │ │ ├── graded | |
│ │ │ │ ├── cfarwell.1 | |
│ │ │ │ │ ├── 1.out | |
│ │ │ │ │ ├── 2.out | |
│ │ │ │ │ ├── 3.out | |
│ │ │ │ │ ├── 4.out |
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 <stdio.h> | |
int main(int argc, char *argv[]) { | |
int i; | |
for (i = 0; i < argc; i++) | |
printf("argv[%d] = '%s'\n", i, argv[i]); | |
} |
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
import java.util.*; | |
class Main { | |
public static void swap(int[] arr, int i, int j) { | |
int tmp = arr[i]; | |
arr[i] = arr[j]; | |
arr[j] = tmp; | |
} | |
public static void permuteRecur(int[] arr, int ndx) { |
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
In [1]: import sys | |
In [2]: for line in sys.stdin: | |
...: print line | |
...: | |
asdf | |
hello | |
world | |
asdf |
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
┌─[ michael@michael-desktop: ~ ] | |
└─> cat test.java | |
class test { | |
public static int f(int a, int b) { | |
return a + b; | |
} | |
public static int g(int f) { | |
return f(f, 3); | |
} | |
public static void main(String[] args) { |
OlderNewer