We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I am using C++ and we are expected to only complete the function. Can someone tell me how can we achieve this without modfying the main function. the function has to return something even if the bill is correctly split and it will be printed to consol
#include<bits/stdc++.h>usingnamespacestd;intbonAppetit(intn,intk,intb,vector<int>ar){// Complete this function}intmain(){intn;intk;cin>>n>>k;vector<int>ar(n);for(intar_i=0;ar_i<n;ar_i++){cin>>ar[ar_i];}intb;cin>>b;intresult=bonAppetit(n,k,b,ar);cout<<result<<endl;return0;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Bill Division
You are viewing a single comment's thread. Return to all comments →
I am using C++ and we are expected to only complete the function. Can someone tell me how can we achieve this without modfying the main function. the function has to return something even if the bill is correctly split and it will be printed to consol