InterviewPrep

Leetcode Integer to Roman Java Solution

Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100…

2 years ago

Leetcode Single Number II Java Solution

Given a non-empty array of integers, every element appears three times except for one, which appears exactly once. Find that single one. Note: Your…

2 years ago

Leetcode Dungeon Game Java Solution

The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists…

2 years ago

Leetcode 787 Cheapest Flights Within K Stops Java Solution

There are n cities connected by m flights. Each flight starts from city u and arrives at v with a price w. Now…

2 years ago

Leetcode 3 Longest Substring Without Repeating Characters

Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The answer…

2 years ago

Leetcode 406 Queue Reconstruction by Height

Suppose you have a random list of people standing in a queue. Each person is described by a pair of…

2 years ago

Leetcode 200 Number of Islands (Java) With Video Explanation

Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water…

2 years ago

Leetcode 56 Merge Intervals (Java)

Given a collection of intervals, merge all overlapping intervals. Example 1: Input: [[1,3],[2,6],[8,10],[15,18]] Output: [[1,6],[8,10],[15,18]] Explanation: Since intervals [1,3] and…

2 years ago

Leetcode 23: Merge K Sorted Lists (Java)

Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [   1->4->5,…

2 years ago

This website uses cookies.