What do you want to save?
Add Code snippet
New code examples
-
Other 2021-11-18 09:57:08
longest increasing subsequence techie delight
#include <iostream> #include <vector> using namespace std; // Iterative function to find longest increasing subsequence // of given array void findLIS(int arr[], int n) { // LIS[i] stores the longest increasing s... Add solution -
Python 2021-11-08 16:38:07
convert c++ code to python online
// Program to print path from root node to destination node // for N*N -1 puzzle algorithm using Branch and Bound // The solution assumes that instance of puzzle is solvable #include <bits/stdc++.h> using namespace std; #define N 3 // state space t... Add solution -
Python 2021-10-19 13:02:13
Find majority element (Boyer–Moore Majority Vote Algorithm)
def majorityElement(A): # `m` stores the majority element (if present) m = -1 # initialize counter `i` with 0 i = 0 # do for each element `A[j]` in the list for j in range(len(A)): # if counter `i` becomes 0 ... Add solution -
Other 2021-10-04 09:48:03
coin change problem minimum number of coins dynamic programming
class Main { // Function to find the minimum number of coins required // to get total of N from set S public static int findMinCoins(int[] S, int N) { &n... Add solution -
SQL 2021-10-02 14:20:06
install postgresql ubuntu 20.04
Step 1 — Installing PostgreSQL To install PostgreSQL, first refresh your server’s local package index: sudo apt update Then, install the Postgres package along with a -contrib package that adds some additional utilities and functionality: ... Add solution -
Other 2021-09-29 02:08:03
Function to find a pair in an array with a given sum using hashing
def findPair(A, sum): # create an empty dictionary dict = {} # do for each element for i, e in enumerate(A): # check if pair `(e, sum-e)` exists # if the difference is seen before, print the pair if sum - e ... Add solution