## The Casino Chips Problem Solved with Python

The challenge You are given three piles of casino chips: white, green and black chips: the first pile contains only white chips the second pile… Read More »The Casino Chips Problem Solved with Python

The challenge You are given three piles of casino chips: white, green and black chips: the first pile contains only white chips the second pile… Read More »The Casino Chips Problem Solved with Python

The challenge An isogram is a word that has no repeating letters, consecutive or non-consecutive. Implement a function that determines whether a string that contains… Read More »Check if Isogram using Python

The challenge Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an… Read More »Find the Longest Common Prefix using Python

The challenge he count-and-say sequence is the sequence of integers with the first five terms as following: 1. 1 2. 11 3. 21 4. 1211… Read More »Count and Say with Python

The challenge Given a non-empty array of digits representing a non-negative integer, increment one to the integer. The digits are stored such that the most significant digit is at… Read More »The Plus One problem solved with Python

The challenge Given a non-empty array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could… Read More »Solving the Single Number problem in Python

The challenge You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Note: You have to rotate the image in-place, which… Read More »Rotate a Matrix List in Python

The challenge of solving valid Sudoku blocks Determine if a 9×9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules: Each… Read More »Check if Valid Sudoku Blocks in Java

The challenge Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = [1,2,2,1], nums2 = [2,2] Output: [2,2] Example 2:… Read More »Find the Intersection of Two Arrays in Python

The challenge Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Input: nums = [1,2,3,4,5,6,7], k = 3 Output: [5,6,7,1,2,3,4]… Read More »Rotate an Array K Times in Python

The challenge Write a program that outputs the string representation of numbers from 1 to n. But for multiples of three it should output “Fizz” instead… Read More »FizzBuzz in Java

Python has a fantastic feature called slices. It allows you to work with a list, set or string by it’s index items. E.g.: You can… Read More »Python Splices reimplemented in Java

The challenge Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each… Read More »Solving Two Sum in Python

The challenge Write a function: def solution(A) that, given an array A of N integers, returns the smallest positive integer (greater than 0) that does… Read More »Get the Next Small Integer in Python

The challenge Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Note: For the purpose of this problem, we… Read More »Is a Valid Palindrome with Java

The challenge Given two strings s and t , write a function to determine if t is an anagram of s. Example 1: Input: s = “anagram”, t = “nagaram” Output: true… Read More »Is a Valid Anagram with Java

What we want to achieve Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Example 1:… Read More »How to ReImplement strStr() in Java

The challenge Given a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexity must… Read More »Third Maximum Number with Java

Why the need to hide icons? Perhaps you have a screen-share session coming up and you want a nice clean desktop to show everyone. Also,… Read More »How to Quickly Hide all Icons on a Mac’s Desktop

The challenge Given a string, find the first non-repeating character in it and return its index. If it doesn’t exist, return -1. Examples: s =… Read More »First Unique Character in a String using Java

What do you do when you create a new Maven Java project, and when you run it, you get the following error: Error:java: error: release… Read More »How to fix the Release Version 5 Not Supported error in IntelliJ

I noticed an interesting thing with a certain visitor after posting a blog post to Facebook. The IP address that the Facebook crawler uses to… Read More »Facebook’s custom IPv6 range

The challenge Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -123 Output: -321 Example… Read More »How to Reverse an Integer in Java

The challenge Write a function that reverses a string. The input string is given as an array of characters char[]. Do not allocate extra space for… Read More »Reverse a String in-place using Java

The challenge Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least… Read More »Check if a Java array Contains Duplicates