## Solving Two Sum in Python

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 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

The challenge Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all… Read More »Find All Numbers Disappeared in an Array using Python

The challenge Students are asked to stand in non-decreasing order of heights for an annual photo. Return the minimum number of students that must move… Read More »The Array Height Checker Problem in Java

The challenge Given an array of integers A sorted in non-decreasing order, return an array of the squares of each number, also in sorted non-decreasing order. Example 1: Input:… Read More »Find the Squares of a Sorted Array in Java

The challenge Given an array A of non-negative integers, return an array consisting of all the even elements of A, followed by all the odd elements of A. You… Read More »Sorting a Java Array by Parity

Say you have an array of primitive integers and you want to remove all duplicates. You can find out how many non-duplicate integers are in… Read More »Remove Duplicates from Sorted Array in Java

The challenge Given an array arr, replace every element in that array with the greatest element among the elements to its right, and replace the last element with -1.… Read More »Replace Elements with Greatest Element on Right Side using Java

Introducing the problem Given an array A of integers, return true if and only if it is a valid mountain array. Recall that A is a mountain array if and… Read More »The Valid Mountain Array Problem using Java

Introduction Java has a built-in called HashMap. It allows you to store and very quickly retrieve key value pairs. In Python, this is called a… Read More »HashMaps (aka: Dictionaries) in Python

The challenge Given an array nums of integers, return how many of them contain an even number of digits. Example 1: Input: nums = [12,345,2,6,7896] Output: 2 Explanation: 12… Read More »Find Numbers with Even Number of Digits using Java

Relational databases first made an appearance in the mid-1970s, between the years 1974 and 1977 with the creation of Ingres and System R which led… Read More »The Relational Database Model

What is a HashSet A HashSet is an unordered collection containing unique elements. It has the standard collection operations Add, Remove, Contains, but since it… Read More »How to use a Java HashSet by example

The challenge In an N by N square grid, each cell is either empty (0) or blocked (1). A clear path from top-left to bottom-right has length k if and… Read More »Get The Shortest Path in Binary Matrix using Python