Pinned Repositories
3SumClosestToTarget
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target.
4SumToTarget
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.
AddTwoNumbersInList
AllPathsFromRootToLeafInBinaryTree
Given a binary tree, return all paths from the root to leaves.
AllPathsFromRootToLeave
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
Anagrams
AS3-PongGame
2D Pong game
BinarySearchTreeAndLinkedList
BinaryTree-FirstCommonAncestor
First Common Ancestor: Design an algorithm and write code to find the first common ancestor
TaskOptimization-Sorting
You need to write a function, which computes the maximum number of tasks that can be completed within the given time T.
AliHassan89's Repositories
AliHassan89/3SumClosestToTarget
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target.
AliHassan89/AllPathsFromRootToLeave
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
AliHassan89/AS3-PongGame
2D Pong game
AliHassan89/ClosestVegetarianRestaurants
Given an array representing the locations of N vegetarian restaurants in the city
AliHassan89/Construct-Quad-Tree
We want to use quad trees to store an N x N boolean grid. Each cell in the grid can only be true or false.
AliHassan89/CountPaths_DynamicProgramming
You are given a grid of cells with size N rows by M columns. A robot is situated at the bottom-left cell. Task is to reach top right.
AliHassan89/DecryptMessage
Encrypted messages consist of lowercase latin letters only, and every word is encrypted separately as follows
AliHassan89/DynamicProgramming-CanSum-HowSum-BestSum
DynamicProgramming-CanSum-HowSum-BestSum
AliHassan89/Find_Element_That_Appears-Once
Given an array where every element occurs three times, except one element which occurs only once.
AliHassan89/FindMinimumInRotatedSortedArray
AliHassan89/HandlingConcurrentCalls
At Booking.com, our customer service team is an important contributor to customer satisfaction.
AliHassan89/Kafka-Twitter-Streaming-API
Connect to the [Twitter Streaming API] and retrieve incoming messages based on keyword in the tweet message
AliHassan89/Longest-increasing-subsequence
Computes and print longest increasing sub sequence using dynamic programming
AliHassan89/LongestCommonSubsequence
Given two sequences, find the longest subsequence present in both of them.
AliHassan89/MakeChange
Total number of ways to make change
AliHassan89/MakeChangeUsingMinCoins
You are given an array of coins and an interger k. Return min number of coins to make value k.
AliHassan89/MaximumProductOfSubArray
Given an array A[] of n integers, the task is to find a subsequence of size k whose product is maximum among all possible k sized subsequences of given array.
AliHassan89/MaximumSumSubArray
Maximum Sum of SubArray
AliHassan89/MinimumPathSum
AliHassan89/PalindromicSubstring
Palindromic Substrings
AliHassan89/PriceScrapper
Scrap prices from grocery retail websites
AliHassan89/ReconstructItinerary-TopologicalSort
Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order.
AliHassan89/RootOfNumber
Many times, we need to re-implement basic functions without using any standard library functions already implemented.
AliHassan89/SearchInRotatedSortedArray
Suppose a sorted array is rotated at some pivot unknown to you beforehand.
AliHassan89/Shortest-distance-from-top-left-to-given-point-in-2D-grid
The area is abstracted as a grid. Not all locations are accessible by road. The truck only needs to make a single delivery.
AliHassan89/ShortestPathBinaryMatrix-BFS
https://leetcode.com/problems/shortest-path-in-binary-matrix/
AliHassan89/Strstr
Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.
AliHassan89/TreeProblems
Tree traversal and other tree related problems
AliHassan89/WordCountEngine
Implement a document scanning function wordCountEngine, which receives a string document and returns a list of all unique words in it and their number of occurrences, sorted by the number of occurrences in a descending order.
AliHassan89/WordLadder
Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence from beginWord to endWord, such that: