This repo will contain the solutions using Java 8 for challenges found on:
- Books
- Hacker Rank
- Codility
- CodeFights
We need to write a function that will return true if we can sort an array swapping only two elements.
We need to write a function to shuffle the digits on a number on a particular way. The first char with the last char, the second char with the second to last char until we use all the digits.
We have phrases composed by sentences and each of this sentences contain words. We need to write a function that will give us the number of words on the longest sentence. The sentences are separated by "?", "!", "." and the words simply by spaces (" ").
A binary gap within a positive integer N is any maximal sequence of consecutive zeros that is surrounded by ones at both ends in the binary representation of N.
We need to perform an array shift to the right a given number of times.
A little frog wants to cross to the other side of the river, but it can only jump to the leaves that fall on the water and only then the complete path from 0 to target has all required leaves. Given the starting position 0, and a non empty array indexed by each second and the position of the leaf. Find the earliest time when the frog can jump all the way from 0 to the target position.
We need to perform a check on an array to see if it's a permutation of N elements where N original size of the array.
Note: A permutation is a sequence containing each element from 1 to N once, and only once.
We need to calculate the values of counters after applying all alternating operations: increase counter by 1; set value of all counters to current maximum.
A guy walks out of a Casino with N chips. We know that he played W times an all in. We need to find the minimum number of plays he could play on the casino to earn those N chips.
We have a line of shoes composed of Left (L) and Right (R) shoes. We want to assign a group of workers to work on the shoes, but we need to guarantee that we assign each worker a group of shoes that contains the same number of L and R shoes.
We need to write a function that return all the odd numbers on a range given the start and the end of the range as integers. This collection will include the start and end integers if they are odd numbers too
We need to write a function that will tell us if all the characters on a given string are unique.
We need to write a function that given two strings let us find if one is a permutation of the other.
Given a String and its true length, transform the string to a URL friendly string by replacing the spaces by %20
Note: We can assume that the string contains a length that allow us to store the additional chars without having to allocate a new string.
Given a string, reverse the characters and return
Given a string, find the first chat that repeats itself.
We had to sort a list of logs given the log level, or the event timestamp.