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.
Taum and B'day
Taum and B'day
Sort by
recency
|
939 Discussions
|
Please Login in order to post a comment
def taumBday(b, w, bc, wc, z): if bc == wc: return (b*bc)+(w*wc) else: if min(bc,wc)+z >= max(bc,wc): return (b*bc)+(w*wc) else: if wc < bc: return ((wc+z)*b)+(w*wc) else: return ((bc+z)*w)+(b*bc)
Here is problem solution in Python, Java, C++, C and Javascript - https://programmingoneonone.com/hackerrank-taum-and-bday-problem-solution.html
Here is my simple c++ solution, you can watch the explanation here : https://youtu.be/T9sxEzAbp-M