/*
 * CS 106B Section 02 Problems
 */

#include <cmath>
#include <iostream>
#include <string>
#include "console.h"
#include "hashset.h"
#include "map.h"
#include "queue.h"
#include "set.h"
#include "stack.h"
#include "vector.h"
using namespace std;

Set<int> twice(Vector<int>& numbers); // section problem 1
Map<string, int> reverseMap(Map<int, string>& map); // section problem 2
int cannonballs(int height); // section problem 3
string reverseStr(string s); // section problem 4
int countWaysToMakeChange(const Vector<int> &denominations, int amount); // section problem 6

int main() {
    setConsoleSize(750, 500);
    setConsoleFont("Monospaced-Bold-14");
    setConsoleEcho(true);

    // test twice
    Vector<int> v;
    v += 1, 2, 2, 3, 4, 4, 4, 5, 5, 6;
    Set<int> s = twice(v);
    cout << "twice: " << s.toString() << " should be {2, 5}" << endl;

    // test reverse map
    Map<int, string> m;
    m.put(1, "a");
    m.put(2, "b");
    m.put(3, "c");
    cout << "reverse (map): " << reverseMap(m).toString() << " should be { \"a\":1, \"b\":2, \"c\":3 }" << endl;

    // test cannonballs
    cout << "cannonballs: " << cannonballs(3) << " should be 14" << endl;

    // test reverse string
    string str = "Hello World";
    cout << "reverse (string): " << reverseStr(str) << " should be dlroW olleH" << endl;

    // test make change
    Vector<int> denominations;
    denominations += 25, 10, 5;
    cout << "countWaysToMakeChange for $1 (100 cents) with 25, 10, 5: "
         << countWaysToMakeChange(denominations, 100) << " should be 29" << endl;
    denominations += 1;
    cout << "countWaysToMakeChange for $1 (100 cents) with 25, 10, 5, 1: "
         << countWaysToMakeChange(denominations, 100) << " should be 242" << endl;

    return 0;
}

Set<int> twice(Vector<int>& numbers) {
    // TODO: finish me
    return {};
}

Map<string, int> reverseMap(Map<int, string>& map) {
    // TODO: finish me
   return {};
}

int cannonballs(int height) {
    // TODO: finish me
    return 0;
}

string reverseStr(string s) {
    // TODO: finish me
    return "";
}

int countWaysToMakeChange(const Vector<int> &denominations, int amount) {
    // TODO: finish me
    return 0;
}
