Tag: algorithms
The n queens puzzle asks to place n queens on an n×n chessboard so that no two queens are attacking each other. Given a two-dimensional integer matrix where 1 …
Given a list of integers nums and an integer k, return the maximum values of each sublist of length k. Constraints 1 ≤ n ≤ 100,000 where n is …
Given a two-dimensional integer matrix, return a new matrix A of the same dimensions where each element is set to A = sum(matrix) for all r ≤ i, c …
You are given a lists of non-negative integers nums. Sort the list in ascending order by the number of 1s in binary representation for each number. If there are …
You are given two lists of integers weights and values which have the same length and an integer capacity. weights and values represent the weight and value of the …