#pragma once// CP01 mastery gate. Closed book, no AI, 40 minutes for all three, starting from this file.// Run from the cp01 folder with .\run.ps1 -Gate// Each body starts as a `throw`; delete it when you write the function.#include<stdexcept>#include<string>#include<unordered_map>#include<vector>// G1. Return how many different values v holds. An empty v holds 0 different values.inlineintcountDistinct(conststd::vector<int>&v){throwstd::logic_error("G1, countDistinct: not written yet");}// G2. s is not empty and holds only the lowercase letters 'a' to 'z'. Return the letter// that appears most often; if several tie, return the one that comes first in the alphabet.inlinecharmostCommonLetter(conststd::string&s){throwstd::logic_error("G2, mostCommonLetter: not written yet");}// G3. Return true if two values at different positions in v add up to target.// Every value, and target, lies between -1'000'000'000 and 1'000'000'000.// It must stay fast for 300'000 values.inlineboolhasPairWithSum(conststd::vector<int>&v,inttarget){throwstd::logic_error("G3, hasPairWithSum: not written yet");}