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.
Cut the sticks
Cut the sticks
Sort by
recency
|
2073 Discussions
|
Please Login in order to post a comment
This is my c++ solution of this problem, you can watch the explanation here : https://youtu.be/jZPhE_MTkVg
anyone help me please, my code passes all test case except 5 and 6.
public static List cutTheSticks(List arr) { // Write your code here
int i=0;
while(i!=arr.size()-1){
if(arr.get(i)!=arr.get(i+1)){
}
i++;
Haskell
C++ O(n log(n)) solution:
Java8