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/WordBreak-DP_solution
AliHassan89/LongestPalindromicSubstring
Find the longest palindromic substring from the given string.
AliHassan89/Container-With-Most-Water
Find two lines, which together with x-axis forms a container, such that the container contains the most water.
AliHassan89/Longest-Common-Prefix
Write a function to find the longest common prefix string amongst an array of strings.
AliHassan89/RemoveElementFromArrayInPlace
Given an array and a value, remove all instances of that value in-place and return the new length.
AliHassan89/SearchInsertPosition-BinarySearch
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.
AliHassan89/MergeUnsortedIntervals
Given a collection of intervals, merge all overlapping intervals.
AliHassan89/LargestNumberFromIntArray
AliHassan89/IsBinaryTreeBalanced
Check Balanced: Implement a function to check if a binary tree is balanced.
AliHassan89/WordPattern
Given a pattern and a string str, find if str follows the same pattern.
AliHassan89/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/NumericPalindrome
A "number palindrome" is a number, that taken backwards, remains the same.
AliHassan89/ChessLibrary
Create the necessary Java classes to implement a chess board (e.g. ChessBoard.java, Piece.java, etc...)
AliHassan89/ProductOfArrayWithoutUsingDivide
Given an array of integers, return a new array such that each element at index i of the new array is the product of all the numbers in the original array except the one at i.
AliHassan89/ValidSudoku
Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.
AliHassan89/SearchForRangeInSortedArray-BinarySearch
Given an array of integers sorted in ascending order, find the starting and ending position of a given target value.
AliHassan89/SwapNodesInPairs
Given a linked list, swap every two adjacent nodes and return its head.
AliHassan89/Remove-Nth-Node-From-End-of-List
Given a linked list, remove the nth node from the end of list and return its head.
AliHassan89/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.
AliHassan89/CloneUndirectedGraph-using-DFS
AliHassan89/IntersectionOfTwoLinkedLists
AliHassan89/ReverseWordsInString
AliHassan89/SumOfThreeEqualToZero
Find all combinations of 3 integers from array whose sum is equal to zero
AliHassan89/URLify
Write a method to replace all spaces in a string with '%20'.
AliHassan89/Determine-if-String-has-unique-characters
AliHassan89/CheckPermutation
AliHassan89/Brackets
Check for balanced parentheses
AliHassan89/AddTwoNumbersInList
AliHassan89/FindSubArray
Given two arrays of integers, where first array is main array and second array is sub-array. Find the starting index in main array where the sub array occurs.
AliHassan89/MergeIntervals
Given a list of sorted intervals. Merge overlapping intervals.