Programming

Jump Search Algorithm In Java

Jump search algorithm is a pretty new algorithm to search for an element in a sorted array. The idea of…

1 year ago

Leetcode Unique Paths Java Solution

A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only…

2 years ago

Leetcode Find the Duplicate Number Solution Java Solution

Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must…

2 years ago

Leetcode 59 Spiral Matrix II Java Solution

Given a positive integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. Example: Input: 3 Output:…

2 years ago

Leetcode 54 Spiral Matrix Java Solution

Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. Example 1: Input: [ [ 1,…

2 years ago

Leetcode 53 Maximum Subarray Java Solution

Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its…

2 years ago

Leetcode 49 Group Anagrams Java Solution

Given an array of strings, group anagrams together. Example: Input: ["eat", "tea", "tan", "ate", "nat", "bat"], Output: [ ["ate","eat","tea"], ["nat","tan"],…

2 years ago

Leetcode 46 Permutations Java Solution

Given a collection of distinct integers, return all possible permutations. Example: Input: [1,2,3] Output: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1] ]…

2 years ago

Leetcode 41 First Missing Positive Java Solution

Given an unsorted integer array, find the smallest missing positive integer. Example 1: Input: [1,2,0] Output: 3 Example 2: Input: [3,4,-1,1]…

2 years ago

Leetcode 37 Sudoku Solver Java Solution

Write a program to solve a Sudoku puzzle by filling the empty cells. A sudoku solution must satisfy all of the following rules:…

2 years ago

This website uses cookies.