November 9, 2020
How to check if the sum exists in an Array List in Java. The sum of what elements equal to the needed value in the Array List (Java)? One of the most commonly asked problems on the technical interview. The basic idea here is to start two loops and check if the sum of the […]
November 9, 2020
How to find duplicate in an array Java? One of the most frequently asked questions on the technical interview. And one of the most straightforward solutions. The only thing you need to do is to convert an array list to the set. And point the element that we can’t add. Why? Because the set collection […]
November 6, 2020
If you have been asked to find a solution for two sum problem in Java on the technical interview, so you need to follow the following steps. Here are several moments you should keep in mind. First of all, you should know that we will use a map collection to hold temporary values. Second, the […]
November 6, 2020
In case you want to check if the string is a palindrome, you should follow several steps. First of all, you have to transform the string into an array of chars. Then you need to set two pointers. The fundamental idea is to compare pointers’ chars. With the help of the “while loop,” we compare […]
November 5, 2020
If you want to reverse an array in Java, you should follow several steps. The general idea to set two pointers. The left pointer’s primary purpose is to start from the array’s left side and move to the center. The right pointer’s primary goal is to begin from the right side and move to the […]
November 3, 2020
To find the minimum value in the array in Java, you should follow several steps. The basic idea to set the temporary variable that we will use to compare with each element in the list. By default, the minimum element should be the first element in the list. With the help of the loop, we […]
November 3, 2020
To resize the array in Java, you should follow several steps. The basic idea to create an empty array list with the needed length. And copy all elements from the first array list to the second. Resize the array list in Java example. Step-by-step implementation.If you want to resize the array list, you have to […]