Calculate the Total Amount of Points using Java
The challenge
Our football team finished the championship. The result of each match look like “x:y”. Results of all matches are recorded …
Read Article →24 articles about interview development, tools, and best practices
Our football team finished the championship. The result of each match look like “x:y”. Results of all matches are recorded …
Read Article →Write a program that outputs the string representation of numbers from 1 to n.
But for multiples of three it should output “Fizz” …
Read Article →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 Article →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] …Read Article →
A HashSet is an unordered collection containing unique elements. It has the standard collection operations Add, Remove, Contains, …
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 …
Given a string s, partition s such that every substring of the partition is a palindrome.
Return all possible palindrome partitioning of s …
Read Article →Say you have an array prices for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum …
Read Article →Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes.
Example: …
Read Article →Given an integer array nums, find the contiguous subarray (containing at least one number) which has the largest sum and return its sum. …
Given a positive integer num, output its complement number. The complement strategy is to flip the bits of its binary representation. …
A self-dividing number is a number that is divisible by every digit it contains.
For example, 128 is a self-dividing number because 128 % …
A valid parentheses string is either empty (""), "(" + A + ")", or A + B, where A and B are valid …
Given an array of strings arr. String s is a concatenation of a sub-sequence of arr which have unique characters.
Return the maximum …
Read Article →Given the root node of a binary search tree, return the sum of values of all nodes with value between L and R (inclusive).
The binary search tree is …
Read Article →Given a fixed length array arr of integers, duplicate each occurrence of zero, shifting the remaining elements to the right.
Note that elements beyond …
Read Article →Let’s say that you have an array or a list, or logs.
Each of these logs is a space-delimited string of words.
For example:
logs = ["dig1 8 …
Take a string S of lowercase letters.
These letters form consecutive groupings of like characters.
Find groups with 3 or more like …
Read Article →This occasionally comes up during coding interviews and is actually quite a decent way to test someone’s aptitude of moving back and forth on a …
Read Article →Let’s say that you have a binary tree and we needed to know it’s maximum depth.
Binary tree input data [3,9,20,null,null,15,7] could be …
Fizz buzz is a common programming interview question.
The problem statement usually reads something like this:
Read Article →Write a short program that …
While there are libraries available for all programming languages that offer abilities to sort list, arrays and collections, it is important to know …
Read Article →Python comes with the power of slicing.
Let’s try it with a String:
>>> example1 = 'hello world'
>>> example1[::-1] …
Read Article →
Reversing a Binary Tree is a common programming interview question.
By learning how to Reverse a Binary Tree in Python, you are working towards …
Read Article →