Skip to content

Instantly share code, notes, and snippets.

@SubtleMuffin
SubtleMuffin / foobar.txt
Created February 15, 2018 03:38
Google Foobar
Solar Doomsday
==============
Who would've guessed? Doomsday devices take a LOT of power. Commander Lambda wants to supplement the LAMBCHOP's quantum antimatter reactor core with solar arrays, and she's tasked you with setting up the solar panels.
Due to the nature of the space station's outer paneling, all of its solar panels must be squares. Fortunately, you have one very large and flat area of solar material, a pair of industrial-strength scissors, and enough MegaCorp Solar Tape(TM) to piece together any excess panel material into more squares. For example, if you had a total area of 12 square yards of solar material, you would be able to make one 3x3 square panel (with a total area of 9). That would leave 3 square yards, so you can turn those into three 1x1 square solar panels.
Write a function answer(area) that takes as its input a single unit of measure representing the total area of solar panels you have (between 1 and 1000000 inclusive) and returns a list of the areas of the largest squares you co
void exhaustiveSearch::recursiveSearcher(std::vector<int> arr, int index, int size,
int currentSum, int targetValue, int &foundCounter, bool printResult) {
static std::vector<int> ans;
if (index == size) {
for (unsigned int i = 0; i < ans.size(); i++) {
currentSum += ans[i];
}
if (currentSum == targetValue) {
if (printResult) {
std::cout << "{ ";
@SubtleMuffin
SubtleMuffin / file
Created April 18, 2016 04:34
freedom_public
{"0.7357587016279541":"-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nCharset: UTF-8\r\n\r\nxv8AAABSBAAAAAATCCqGSM49AwEHAgMEQQ9FPj9I/fgf+QtFe1H26LdY821QrLn6\r\nz0iNzty2PHMJKuE8Ojbw+y9TwiWfCPtfCnG5OZ2Jrd/0uLjs9f3t483/AAAACDxn\r\naXRodWI+wv8AAACNBBATCAA//wAAAAWCVxRj4f8AAAACiwn/AAAACZD9+GLjHhgu\r\nNf8AAAAFlQgJCgv/AAAAA5YBAv8AAAACmwP/AAAAAp4BAAASzAD/XjLwJ6QIhp5L\r\n2YEmSS0uEkkEBkOlj0WBA3Lvrs7NQzsBAKwAbo/n81iHH9VwLT5aXK7rMiClQkYj\r\n1EbnNQZmAxKhzv8AAABWBAAAAAASCCqGSM49AwEHAgMEu4Ue31aZwEa2fsiQjM5T\r\nRYm/HYa/n7UNSCx/w5GPgWSILq1RmX2dKhbJ5Km9kVGwPQHohJByitxz3xDFEYGq\r\nPgMBCAfC/wAAAG0EGBMIAB//AAAABYJXFGPh/wAAAAmQ/fhi4x4YLjX/AAAAApsM\r\nAAAanQEA3XqJ3Ogn2FC/xsH7BvtHDMlYtlTtTx98yu/muTn0ukoBAOrOdcAQaCsU\r\nQRxMHhESMbcZpcnm4UNfJ0VvatVn4sUr\r\n=uFE0\r\n-----END PGP PUBLIC KEY BLOCK-----\r\n"}

nihao

test

hha

houh