/algorithms-java

Java solutions for HackerRank and LeeCode challenges

Primary LanguageJava

Algorithms-java repository

The repository contains solutions of HackerRank and Leecode challenges written in java.

Solutions

HackerRank

Array Manipulation

Arrays: Left Rotation

Minimum Swaps 2

New Year Chaos

2D Array - DS

Flipping bits

Greedy Florist

Count Triplets

Frequency Queries

Hash Tables: Ransom Note

Sherlock and Anagrams

Two String

LeeCode

1086. High Five

706. Design HashMap

415. Add Strings

387. First Unique Character in a String

350. Intersection of Two Arrays II

346. Moving Average from Data Stream

283. Move Zeroes

278. First Bad Version

217. Contains Duplicate

206. Reverse Linked List

155. Min Stack

151. Reverse Words in a String

136. Single Number

122. Best Time to Buy and Sell Stock II

121. Best Time to Buy and Sell Stock

93. Delete Node in a Linked List

91. Decode Ways

53. Maximum Subarray

21. Merge Two Sorted Lists

20. Valid Parentheses

13. Roman to Integer

7. Reverse Integer

1. Two Sum

Remove Duplicates from Sorted Array

1578. Minimum Time to Make Rope Colorful

Educative

Smallest Subarray with a given sum (easy)

Longest Substring with maximum K Distinct Characters (medium)

Fruits into Baskets

Longest Substring with Distinct Characters (hard)

Longest Substring with Same Letters after Replacement (hard) Longest Subarray with Ones after Replacement (hard) Permutation in a String (hard)# String Anagrams (hard)# Smallest Window containing Substring (hard)# Pair with Target Sum (easy) Remove Duplicates (easy) Squaring a Sorted Array (easy) Triplet Sum Close to Target (medium) Triplets with Smaller Sum (medium) Subarrays with Product Less than a Target (medium) Dutch National Flag Problem (medium) LinkedList Cycle (easy) Happy Number (medium) Middle of the LinkedList (easy) Merge Intervals (medium) Insert Interval (medium) Intervals Intersection (medium) Conflicting Appointments (medium) Minimum Meeting Rooms (hard) Maximum CPU Load (hard) Find the Missing Number (easy) Find all Missing Numbers (easy) Find the Duplicate Number (easy) Find all Duplicate Numbers (easy) Reverse a LinkedList (easy) Reverse a Sub-list (medium) Binary Tree Level Order Traversal (easy) Reverse Level Order Traversal (easy) Zigzag Traversal (medium) Level Averages in a Binary Tree (easy) Minimum Depth of a Binary Tree (easy) Level Order Successor (easy) Binary Tree Path Sum (easy) Find the Median of a Number Stream (medium) Maximize Capital (hard)