MCPcopy Create free account

hub / github.com/BlakeBrown/HackerRank-Solutions / functions

Functions371 in github.com/BlakeBrown/HackerRank-Solutions

↓ 31 callersMethodinsert
(head,value)
30 Days of Code/Day 15/Linked List.rb:13
↓ 25 callersFunctionthreeDigitContribution
Long answer I came up with during the contest, basically use DP to count the # of contributions
Contests/2017 - Week of Code 28/Lucky Number Eight.cpp:33
↓ 13 callersFunctionsmall
0 to 19
Contests/Project Euler/017.cpp:11
↓ 12 callersMethodfront
Tutorials/Cracking the Coding Interview/Queues - A Tale of Two Stacks.cpp:30
↓ 9 callersMethodpop
Tutorials/Cracking the Coding Interview/Queues - A Tale of Two Stacks.cpp:19
↓ 8 callersFunctiontens
20 to 99
Contests/Project Euler/017.cpp:54
↓ 7 callersFunctionhundreds
100 to 999
Contests/Project Euler/017.cpp:90
↓ 6 callersFunctionPath
Returns the path from source to destination
Contests/2016 - Week of Code 20/Synchronous Shopping.cpp:14
↓ 6 callersMethodinsert
(int x)
Useful Code Blocks/Java/inOrderTraversal.java:16
↓ 6 callersMethodpush
Tutorials/Cracking the Coding Interview/Queues - A Tale of Two Stacks.cpp:15
↓ 5 callersFunctionfind
A utility function to find set of an element i (uses path compression technique)
Algorithms/Graph Theory/Kruskal's MST - Really Special Subtree.cpp:34
↓ 5 callersFunctionread
()
30 Days of Code/Day 12/Inheritence.js:10
↓ 5 callersFunctionthreeDigitContributionEven
Contests/2017 - Week of Code 28/Lucky Number Eight.cpp:37
↓ 5 callersFunctionthreeDigitContributionOdd
Contests/2017 - Week of Code 28/Lucky Number Eight.cpp:68
↓ 4 callersFunctioncountDivisors
Returns the number of divisors of n
Contests/Project Euler/012.cpp:10
↓ 4 callersFunctiondayOfTheWeek
Zeller's congruence 0 = saturday, 1 = sunday, 2 = monday, 3 = tuesday, 4 = wednesday, 5 = thursday, 6 = friday
Contests/Project Euler/019.cpp:10
↓ 4 callersFunctiondegree2radians
Contests/2016 - Booking.com Backend/Coupling Passions.cpp:12
↓ 4 callersFunctionfind
A utility function to find set of an element i (uses path compression technique)
Contests/2017 - Week of Code 28/The Value of Friendship.cpp:42
↓ 4 callersFunctionfind
A utility function to find set of an element i (uses path compression technique)
Contests/2015 - World Cup, University Level CodeSprint/Travel in Hackerland.cpp:31
↓ 4 callersFunctiongetValue
Gets the value of a binary string
Contests/2016 - Week of Code 22/Submask Queries.cpp:10
↓ 3 callersFunctionforn
Algorithms/Searching/Gena Playing Hanoi.cpp:81
↓ 3 callersMethodget_array
()
30 Days of Code/Day 27/Testing.py:12
↓ 3 callersFunctionhexToBinary
Algorithms/Bit Manipulation/A or B.cpp:48
↓ 3 callersFunctionhexToBinary
Contests/2016 - June World Codesprint/A or B.cpp:48
↓ 3 callersFunctionminimum_index
(seq)
30 Days of Code/Day 27/Testing.py:1
↓ 3 callersFunctionreadLine
()
30 Days of Code/Day 02/Operators.js:21
↓ 3 callersFunctionreadLine
()
30 Days of Code/Day 01/Data Types.js:18
↓ 3 callersFunctionsumUpToN
Contests/Project Euler/001.cpp:8
↓ 3 callersFunctionthousands
1000 to 999,999
Contests/Project Euler/017.cpp:105
↓ 2 callersFunctionaddBitStrings
The main function that adds two bit sequences and returns the addition
Algorithms/Graph Theory/Roads in Hackerland.cpp:41
↓ 2 callersFunctionaddBitStrings
The main function that adds two bit sequences and returns the addition
Contests/2016 - June World Codesprint/Roads in Hackerland.cpp:41
↓ 2 callersFunctionbinaryToHex
Algorithms/Bit Manipulation/A or B.cpp:12
↓ 2 callersFunctionbinaryToHex
Contests/2016 - June World Codesprint/A or B.cpp:12
↓ 2 callersMethodcalculate
()
30 Days of Code/Day 12/Inheritence.js:48
↓ 2 callersMethodget_expected_result
()
30 Days of Code/Day 27/Testing.py:24
↓ 2 callersFunctioninsertEdge
Algorithms/Graph Theory/Dijkstra's SSSP - Shortest Reach 2.cpp:28
↓ 2 callersFunctionlogBase
Contests/Project Euler/025.cpp:10
↓ 2 callersFunctionmillions
1,000,000 to 999,999,999
Contests/Project Euler/017.cpp:140
↓ 2 callersFunctionoutputAnswer
Removes leading zeroes from answer, or outputs one '0' if s is all zeroes
Algorithms/Bit Manipulation/A or B.cpp:70
↓ 2 callersFunctionoutputAnswer
Removes leading zeroes from answer, or outputs one '0' if s is all zeroes
Contests/2016 - June World Codesprint/A or B.cpp:70
↓ 2 callersFunctionreadLine
()
30 Days of Code/Day 07/Arrays.js:21
↓ 2 callersFunctionreadLine
()
30 Days of Code/Day 04/Class vs. Instance.js:17
↓ 1 callersFunctionSum
(arr, x, y)
30 Days of Code/Day 11/2D Arrays.rb:3
↓ 1 callersFunctionTestWithEmptyArray
()
30 Days of Code/Day 27/Testing.py:41
↓ 1 callersFunctionTestWithUniqueValues
()
30 Days of Code/Day 27/Testing.py:51
↓ 1 callersFunctionTestiWithExactyTwoDifferentMinimums
()
30 Days of Code/Day 27/Testing.py:62
↓ 1 callersFunctionUnion
A function that does union of two sets of x and y (uses union by rank)
Algorithms/Graph Theory/Kruskal's MST - Really Special Subtree.cpp:45
↓ 1 callersFunctionUnion
A function that does union of two sets of x and y (uses union by rank)
Contests/2017 - Week of Code 28/The Value of Friendship.cpp:53
↓ 1 callersFunctionUnion
A function that does union of two sets of x and y (uses union by rank)
Contests/2015 - World Cup, University Level CodeSprint/Travel in Hackerland.cpp:42
↓ 1 callersMethod__init__
(self,title,author)
30 Days of Code/Day 13/Abstract Classes.py:3
↓ 1 callersMethodaddName
(String s)
Useful Code Blocks/Java/Tries - Contacts.java:24
↓ 1 callersFunctionarray_left_rotation
Tutorials/Cracking the Coding Interview/Arrays - Left Rotation.cpp:26
↓ 1 callersFunctionbfs
Algorithms/Searching/Gena Playing Hanoi.cpp:50
↓ 1 callersFunctionbillions
1,000,000,000 to 999,999,999,999
Contests/Project Euler/017.cpp:177
↓ 1 callersFunctionbinarysearch
Algorithms/Searching/Binary Search.cpp:6
↓ 1 callersMethodcalculate
30 Days of Code/Day 12/Inheritence.rb:18
↓ 1 callersFunctioncalculateCurrentSum
(arr,x,y)
30 Days of Code/Day 11/2D Arrays.js:25
↓ 1 callersFunctioncanAddVertex
Returns true if adding the vertex to the set keeps the set independent, false otherwise
Contests/2016 - Week of Code 21/Demanding Money.cpp:23
↓ 1 callersFunctioncheck
Algorithms/Strings/separate-the-numbers.cpp:8
↓ 1 callersMethodcomputeDifference
(self)
30 Days of Code/Day 14/Scope.py:7
↓ 1 callersFunctioncountingSort
Complete the countingSort function below.
Algorithms/Sorting/Counting sort2.cpp:8
↓ 1 callersFunctioncutEdges
Returns the number of edges that can be cut from the tree
Algorithms/Graph Theory/Even Tree.cpp:22
↓ 1 callersMethoddequeueCharacter
(self)
30 Days of Code/Day 18/Queue and stacks.py:15
↓ 1 callersFunctiondetermineContribution
Determines an indices contribution to the number of "nice sequences"
Contests/2016 - Week of Code 22/Number of Sequences.cpp:13
↓ 1 callersFunctiondfs
Returns the number of nodes visited in a dfs
Algorithms/Graph Theory/Even Tree.cpp:9
↓ 1 callersFunctiondfs
Contests/2015 - Magic Lines September/Connected Cell in a Grid 1.cpp:17
↓ 1 callersFunctiondijkstra
Function that implements Dijkstra's algorithm using adjacency list representation of a graph
Algorithms/Graph Theory/Dijkstra's SSSP - Shortest Reach 2.cpp:42
↓ 1 callersFunctiondisplay
30 Days of Code/Day 24/More Linked List.c:61
↓ 1 callersMethoddisplay
(head)
30 Days of Code/Day 15/Linked List.rb:30
↓ 1 callersMethoddisplay
()
30 Days of Code/Day 13/Abstract Classes.py:7
↓ 1 callersFunctiondisplayPathtoPrincess
(n,grid)
Machine Learning/Bot Building/Bot saves princess.py:1
↓ 1 callersFunctiondistance_between
Contests/2016 - Booking.com Backend/Coupling Passions.cpp:16
↓ 1 callersMethoddivisorSum
(self, n)
30 Days of Code/Day 19/Interfaces.py:6
↓ 1 callersMethodencrypt
(char x, int k)
Algorithms/Strings/Caesar Cipher.java:22
↓ 1 callersFunctionencryption
Complete the encryption function below.
Algorithms/Implementation/Encryption.cpp:6
↓ 1 callersMethodenqueueCharacter
(self, char)
30 Days of Code/Day 18/Queue and stacks.py:20
↓ 1 callersFunctionfactorial
(n)
30 Days of Code/Day 09/Factorial Using Recursion.py:1
↓ 1 callersFunctionfactorial
(n)
30 Days of Code/Day 09/Recursion 3.js:28
↓ 1 callersFunctionfindIndependentSets
Recursively finds all the independent sets in the graph
Contests/2016 - Week of Code 21/Demanding Money.cpp:35
↓ 1 callersFunctionfindMedian
Complete the findMedian function below.
Algorithms/Sorting/Find the Median.cpp:8
↓ 1 callersMethodfindPartial
(String s)
Useful Code Blocks/Java/Tries - Contacts.java:39
↓ 1 callersFunctionfindPath
Algorithms/Searching/Count Luck.cpp:15
↓ 1 callersMethodgetHeight
(self,root)
30 Days of Code/Day 22/Binary search tree.py:18
↓ 1 callersFunctioninOrderTraversal
Perform a recursive in-order traversal and ensure order is strictly increasing
Tutorials/Cracking the Coding Interview/Trees - Is this a Binary Search Tree?.cpp:14
↓ 1 callersMethodinOrderTraversal
(Node node)
Useful Code Blocks/Java/inOrderTraversal.java:49
↓ 1 callersFunctioninsert
30 Days of Code/Day 24/More Linked List.c:36
↓ 1 callersMethodinsert
(self,root,data)
30 Days of Code/Day 23/BST Level-Order Traversal.py:8
↓ 1 callersMethodinsert
(self,root,data)
30 Days of Code/Day 22/Binary search tree.py:6
↓ 1 callersFunctioninsertionSort
Algorithms/Sorting/Insertion Sort - Part 2.cpp:10
↓ 1 callersFunctioninsertionSort
Slower version of insertion-sort as shown here: https://en.wikipedia.org/wiki/Insertion_sort Returns the number of shifts performed during the sort
Algorithms/Sorting/Running Time of Quicksort.cpp:6
↓ 1 callersMethodisAnagram
(String a, String b)
Algorithms/Strings/Anagram.java:5
↓ 1 callersFunctionisPrime
Contests/Project Euler/027.cpp:20
↓ 1 callersFunctionis_balanced
Tutorials/Cracking the Coding Interview/Stacks - Balanced Brackets.cpp:26
↓ 1 callersFunctionis_leap
(year)
Python/Write a function.py:1
↓ 1 callersFunctionkaprekar
Algorithms/Implementation/Kaprekar-Numbers.cpp:8
↓ 1 callersFunctionlengthOfCycle
Returns the length of the cycle for 1/n Note: The largest possible cycle length is n-1, since during long division if we hit a remainder that we've vi
Contests/Project Euler/026.cpp:10
↓ 1 callersMethodlevelOrder
(self,root)
30 Days of Code/Day 23/BST Level-Order Traversal.py:20
↓ 1 callersFunctionlexographicPermutation
Returns the Nth lexographic permutation of a lexographically sorted string with unique characters Uses combinatorics and dynamic programming, see algo
Contests/Project Euler/024.cpp:30
↓ 1 callersFunctionlonelyinteger
Algorithms/Bit Manipulation/Lonely Integer.cpp:20
↓ 1 callersFunctionltrim
Algorithms/Bit Manipulation/Sum vs XOR.cpp:40
next →1–100 of 371, ranked by callers