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.
Halloween Sale
Halloween Sale
Sort by
recency
|
652 Discussions
|
Please Login in order to post a comment
My solution in Java language. Sorry because this time, i excluded the explaination.
int howManyGames(int p, int d, int m, int s) {
}
can anyone explain me what is problem in my code :
public static int howManyGames(int p, int d, int m, int s) {
int count=0;
int sum = p;
return count;
} }
Here are my approaches in c++, you can see the explanation here : https://youtu.be/VFVaLMRzhV4
Approach 1 O(n)
Approach 2 O(n) with recursion
Approach 3 O(1), incomplete solution (failure of a test case), feel free to comment to share a way to complete it.