MCPcopy Create free account

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

Functions371 in github.com/BlakeBrown/HackerRank-Solutions

Functionmain
Both series have closed form solutions
Contests/Project Euler/006.cpp:9
Functionmain
Trick: Super large numbers should be read/stored as a string (Other than that we can brute force the solution)
Contests/Project Euler/008.cpp:10
Functionmain
Contests/Project Euler/024.cpp:74
Functionmain
Explanation: Binet's formula to calculate the nth fibonacci number is: Fib(n) = (Phi^n - (-phi)^-n)/sqrt(5) Since (-phi)^-n approaches 0 as n->infinit
Contests/Project Euler/025.cpp:28
Functionmain
Problem requires Fundamental Theorem of Arithmetic and some careful thinking
Contests/Project Euler/005.cpp:9
Functionmain
Don't need to check left, up or 2/4 diagonals
Contests/Project Euler/011.cpp:9
Functionmain
Contests/Project Euler/022.cpp:11
Functionmain
Summary of algorithm: Triangular numbers are of the form T(n) = n(n+1)/2 After generating a triangular number, we need to find how many divisors it ha
Contests/Project Euler/012.cpp:36
Functionmain
Finds the largest prime factor of N
Contests/Project Euler/003.cpp:9
Functionmain
Contests/Project Euler/010.cpp:9
Functionmain
Contests/Project Euler/019.cpp:28
Functionmain
Contests/Project Euler/023.cpp:83
Functionmain
Contests/Project Euler/027.cpp:31
Functionmain
Contests/Project Euler/018.cpp:9
Functionmain
Note: Look into Euclid's formula of generating primitive pythagorean triples for future questions
Contests/Project Euler/009.cpp:9
Functionmain
Contests/Project Euler/001.cpp:12
Functionmain
Contests/Project Euler/021.cpp:83
Functionmain
Useful information to know for future challenges: - All primes greater than 3 can be written in the form 6k +/- 1 - N can't have a prime factor greate
Contests/Project Euler/007.cpp:12
Functionmain
Contests/Project Euler/017.cpp:241
Functionmain
Use dynamic programming (memoization)
Contests/Project Euler/014.cpp:14
Functionmain
Contests/Project Euler/026.cpp:30
Functionmain
Contests/2017 - Week of Code 28/The Value of Friendship.cpp:74
Functionmain
Contests/2017 - Week of Code 28/Lucky Number Eight.cpp:97
Functionmain
Contests/2017 - Week of Code 28/The Great XOR.cpp:57
Functionmain
Contests/2017 - Week of Code 28/Boat Trips.cpp:27
Functionmain
Contests/2015 - World Cup, University Level CodeSprint/Beautiful Quadruples (Brute force).cpp:27
Functionmain
Contests/2015 - World Cup, University Level CodeSprint/World Cup Team Formation.cpp:9
Functionmain
Contests/2015 - World Cup, University Level CodeSprint/Beautiful Quadruples 2.cpp:27
Functionmain
Contests/2015 - World Cup, University Level CodeSprint/Travel in Hackerland.cpp:68
Functionmain
Contests/2015 - World Cup, University Level CodeSprint/Swapping Bridges.cpp:9
Functionmain
Contests/2016 - Week of Code 22/Cookie Party.cpp:55
Functionmain
Contests/2016 - Week of Code 22/Matching Sets.cpp:9
Functionmain
Contests/2016 - Week of Code 22/Number of Sequences.cpp:22
Functionmain
This question basically boils down to a good understanding of geometry. I could explain it pretty well with a diagram, but I'm a little lazy so I'll o
Contests/2016 - Week of Code 22/Making Polygons.cpp:30
Functionmain
Observation 1: We don't need to actually generate every subset Observation 2: We can quickly represent a subset using the value of it's binary string
Contests/2016 - Week of Code 22/Submask Queries.cpp:23
Functionmain
Contests/2016 - Week of Code 21/Demanding Money.cpp:58
Functionmain
We can represent the position of kangaroo 1 & 2 using two linear equations Kangaroo 1: x1 + v1*t, Kangaroo 2: x2 + v2*t There'll be an intersection if
Contests/2016 - Week of Code 21/Kangaroo.cpp:30
Functionmain
Contests/2016 - Week of Code 21/Luck Balance.cpp:9
Functionmain
Contests/2016 - Week of Code 20/Divisible Sum Pairs.cpp:27
Functionmain
Contests/2016 - Week of Code 20/Non-divisible Subset.cpp:17
Functionmain
Contests/2016 - Week of Code 20/Synchronous Shopping.cpp:27
Functionmain
Useful Code Blocks/Print Powerset (all subsets).cpp:24
Functionmain
Useful Code Blocks/Print Permutations.cpp:49
Functionmain
30 Days of Code/Day 07/Arrays.c:5
Functionmain
30 Days of Code/Day 20/Sorting.c:1
Functionmain
30 Days of Code/Day 05/Loops.c:3
Functionmain
30 Days of Code/Day 25/Running Time and Complexity.c:6
Functionmain
30 Days of Code/Day 29/Bitwise AND.c:11
Functionmain
30 Days of Code/Day 06/Let's Review.c:21
Functionmain
30 Days of Code/Day 26/Nested Logic.c:6
Functionmain
30 Days of Code/Day 24/More Linked List.c:70
Methodmain
(String[] args)
Algorithms/Strings/HackerRank in a String.java:9
Methodmain
(String[] args)
Algorithms/Strings/Mars Exploration.java:9
Methodmain
(String[] args)
Algorithms/Strings/Anagram.java:45
Methodmain
(String[] args)
Algorithms/Strings/CamelCase.java:9
Methodmain
(String[] args)
Algorithms/Strings/Super Reduced String.java:35
Methodmain
(String[] args)
Algorithms/Strings/Caesar Cipher.java:6
Methodmain
(String[] args)
Algorithms/Dynamic Programming/Fibonacci Modified.java:9
Methodmain
(String[] args)
Contests/Project Euler/015.java:9
Methodmain
(String[] args)
Contests/Project Euler/020.java:9
Methodmain
(String[] args)
Contests/Project Euler/016.java:9
Methodmain
(String[] args)
Contests/Project Euler/013.java:9
Methodmain
(String[] args)
Contests/Project Euler/028.java:13
Methodmain
(String[] args)
Useful Code Blocks/Java/Tries - Contacts.java:52
Methodmain
(String[] args)
Useful Code Blocks/Java/fib.java:13
Methodmain
(String[] args)
Useful Code Blocks/Java/inOrderTraversal.java:59
Methodmain
(String[] args)
Useful Code Blocks/Java/islands.java:20
FunctionnextLexographicPermutation
Returns the next lexographic permutation of string s
Useful Code Blocks/Lexographic Algorithms.cpp:21
Functionprint_rangoli
(size)
Python/Alphabet_Rangoli.py:6
FunctionprocessData
(inputString)
30 Days of Code/Day 00/helloworld.js:1
Functionvisit
Contests/2017 - Week of Code 28/The Great XOR.cpp:26
← previous301–371 of 371, ranked by callers