Category: algorithms
Given an array of positive integers arr, find a pattern of length m that is repeated k or more times. A pattern is a subarray (consecutive sub-sequence) that consists …
Given an array of integers A, We need to sort the array performing a series of pancake flips. In one pancake flip we do the following steps: Choose an …
The Union-Find (Disjoint Set) is a commonly-used algorithm that can solve e.g. Minimal Spanning Tree. The following is a Java implementation of a Union-Find Class. package com.helloacm; public class …
Consider the following function to make changes to an array of numbers: func modify(arr, op, idx) { // add by 1 index idx if (op == 0) { arr …
Use digit 1 to 8 only once and fill the below grid: The arithmetic should proceed exactly from left to right and top to the bottom. Bruteforce Algorithm to …