What do you want to save?
Add Code snippet
New code examples
-
C++ 2022-03-15 06:55:06
segment tree complexity
// C++ program to show segment tree operations like construction, query // and update #include <bits/stdc++.h> using namespace std; // A utility function to get the middle index from corner indexes. int getMid(int s, int e) { return s + (e -s)... Add solution -
Python 2022-01-26 07:20:51
Function to check if a sublist with zero-sum is present in a given list or no
def hasZeroSumSublist(A): # create an empty set to store the sum of elements of each # sublist `A[0…i]`, where `0 <= i < len(A)` s = set() # insert 0 into the set to handle the case when sublist with # zero-sum starts ... Add solution -
Python 2021-11-07 13:47:15
sum axis in python
import numpy as np array1 = np.array( [[1, 2], [3, 4], [5, 6]]) total_0_axis = np.sum(array1, axis=0) print(f'Sum of elements at 0-axis is {total_0_axis}') total_1_axis = np.sum(array1, axis=1) print(f'Sum of elements at 1-axis is {total_... Add solution -
C 2021-10-16 12:09:12
Segment tree
// C++ program to show segment tree operations like construction, query // and update #include <bits/stdc++.h> using namespace std; // A utility function to get the middle index from corner indexes. int getMid(int s, int e) { return s + (e -s)... Add solution