Algorithms

Leetcode 24 Swap Nodes in Pairs Java Solution

Given a linked list, swap every two adjacent nodes and return its head. You may not modify the values in the list's nodes,…

2 years ago

Leetcode 21 Merge Two Sorted Lists Java Solution

Merge two sorted linked lists and return it as a new sorted list. The new list should be made by splicing together…

2 years ago

Leetcode 20 Valid Parentheses Java Solution

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if:…

2 years ago

Leetcode 19 Remove Nth Node From End of List Java Solution

Given a linked list, remove the n-th node from the end of list and return its head. Example: Given linked list:…

2 years ago

Leetcode 2 Add Two Numbers Java Solution

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain…

2 years ago

Leetcode 1 Two Sum Java Solution

Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may…

2 years ago

Trapping Rain Water Problem LeetCode Java Solution

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is…

2 years ago

This website uses cookies.