SubdomainChallengeSolutionVideo Explaination Sorting Quicksort 1 - Partition Quicksort1Partition.java Sorting Marc's Cakewalk MarcsCakewalk.java Sorting Minimum Absolute Difference in an Array MinimumAbsoluteDifferenceInAnArray.java Sorting Luck Balance LuckBalance.java Sorting Climbing the Leaderboard Cl...
if two strings have the same integers, you need to print the strings in their original order. Hence, your sorting algorithm should bestable, i.e. the original order should be maintained for equal elements.
O(n + q) O(n + q) Medium 25 n = number of input strings, q = number of queries Dynamic Array C# O(q) O(n) Easy 15 q = Number of queriesLinked Lists#TitleSolutionTimeSpaceDifficultyPointsNote Print the Elements of a Linked List C++ O(n) O(1) Easy 5 Reverse a Linked List...
Given a set of N points, Find the perimeter of the convex hull for the points. Why to ask this question: This question is hard CS/computational geometry. It might be useful for data analysis or mapping. It's unlikely that an ad-hoc solution can be developed during an interview and two...
Sorting Minimum Absolute Difference in an Array 15 Solution.java Sorting Luck Balance 20 Solution.java Sorting Insertion Sort - Part 1 30 Solution.java Sorting Insertion Sort - Part 2 30 Solution.java Sorting Correctness and the Loop Invariant 30 Solution.java Sorting Running Time of Algorithms 30...
Unfairness of an array is calculated as Where: - max denotes the largest integer in - min denotes the smallest integer in Example Pick any two elements, say . Testing for all pairs, the solution provides the minimum unfairness. Note: Integers in may not be unique. Function ...
INPUT Hello,hello ; expected output:anagram ; actual : not anagram; public static boolean isAnagram(String a,String b) { char a1[]=a.toCharArray(); char b1[]=b.toCharArray(); java.util.Arrays.sort(a1); java.util.Arrays.sort(b1);...
Sorting Minimum Absolute Difference in an Array 15 Solution.java Sorting Luck Balance 20 Solution.java Sorting Insertion Sort - Part 1 30 Solution.java Sorting Insertion Sort - Part 2 30 Solution.java Sorting Correctness and the Loop Invariant 30 Solution.java Sorting Running Time of Algorithms 30...
O(n + q) O(n + q) Medium 25 n = number of input strings, q = number of queries Dynamic Array C# O(q) O(n) Easy 15 q = Number of queriesLinked Lists#TitleSolutionTimeSpaceDifficultyPointsNote Print the Elements of a Linked List C++ O(n) O(1) Easy 5 Reverse a Linked List...
-Bottom-upis when we solve the easiest sub-problem first and use that solution directly to solve a "higher" problem. -Top-downis when we cache the solutions to sub-problems in the course of solving a "higher" problem. We can then access those cached solutions when attempting to solve ot...