Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class OkonomiyakiShop {
public:
int count(vector<int> osize, int K) {
int cnt=0;
for (int i=0; i<osize.size(); i++) {
for (int j=i+1; j<osize.size(); j++)
{
if(abs(osize[i]-osize[j])<=K)
cnt++;
}
}
return cnt;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment