Skip to content

Instantly share code, notes, and snippets.

(function() {
var g, k = this, aa = function(a) {
var b = typeof a;
if ("object" == b)
if (a) {
if (a instanceof Array)
return "array";
if (a instanceof Object)
return b;
var c = Object.prototype.toString.call(a);
@bugkill3r
bugkill3r / beautifulstring.cpp
Last active December 16, 2015 18:59
My solution to Facebook Hacker Cup 2013 Qualification Round: Beautiful Strings
/*
The idea here is that to get the overall maximum beauty of the string you must assign
maximum beauty possible(26) to the most frequent alphabet and then 25 to the second most
frequent alphabet and so on.
And yes, in the code, sweetness and beauty means the same.
*/
#include<iostream>
#include<cstdio>
#include<algorithm>