Skip to content

charlesncn/LeetCodeSolutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

DSA Problems and Solutions

Given an m x n 2D binary grid which represents a map of '1's (land) and '0's (water), return the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water.

Given an unsorted array of integers nums, return the length of the longest consecutive elements sequence. You must write an algorithm that runs in O(n) time.

Implement a list using an array in JAVA. The list should be able to perform the following operations:

  1. size.
  2. isEmpty.
  3. contains.
  4. add.
  5. remove.
  6. get.
  7. set.
  8. clear.

Given a string s, return the longest palindromic substring in s.

Input: s = "babad". Output: "bab". Note: "aba" is also a valid answer.
Input: s = "cbbd". Output: "bb".

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages