Skip to content

Instantly share code, notes, and snippets.

View momchil-velikov's full-sized avatar

Momchil Velikov momchil-velikov

  • Arm
  • Cambridge, United Kingdom
View GitHub Profile
#include <unordered_map>
#include <string>
#include <iostream>
void sorted(const std::string &a, const std::string &order) {
std::unordered_map<char, unsigned int> count;
for (auto c : a)
++count[c];
for (auto c: order) {
for (auto i = count[c]; i > 0; --i)
@momchil-velikov
momchil-velikov / gist:8207534
Last active September 9, 2016 14:39
ISO C99 grammar
/* ISO/IEC 9988:1999 grammar (ISO C) */
%token ID TYPEDEF_NAME INT_CST STRING_CST SIZEOF ;
%token ARROW INC DEC ;
%token LSHIFT RSHIFT ;
%token LE GE ;
%token EQ NE ;
%token ANDAND OROR ;
package main
import (
"fmt"
"io"
"strings"
)
const (
None = iota