Skip to content

Instantly share code, notes, and snippets.

View prathyvsh's full-sized avatar

Prathyush prathyvsh

View GitHub Profile
Iterable<Map<String,int>>parseCSV(String csv) {
return csv.split("\n").map((String s) {
List<String> kv = s.split(",");
String k = kv[0];
num v = int.parse(kv[1]);
return {k: v};
@prathyvsh
prathyvsh / main.dart
Last active May 7, 2020 21:16
Leaderboard
import "dart:math";
List<List<String>> csv;
void main() {
csv = [
["1", "Orange", "3"],
["2", "Apple", "4"],
["3", "Lemon", "4"],
["42", "Grapes", "6"]
@prathyvsh
prathyvsh / expr.c
Created April 18, 2020 14:19 — forked from pervognsen/expr.c
void parse_expr(Value *dest);
Sym *parse_ident(void) {
if (tok != TOK_IDENT) {
error("Expected identifier");
}
Sym *ident = tok_sym;
next();
return ident;
}