Blog: programcreek 
216 blogs
updated: 48 min. ago


Automatically detecting server downtime using Linux cron job
If you run a website, you may have experienced some down time. Occasionally, the web server can go down. It would be great if we can get not...


LeetCode – Russian Doll Envelopes (Java)
You have a number of envelopes with widths and heights given as a pair of integers (w, h). One envelope can fit into another if and only if ...


Maximum Sum of Subarray Close to K
Given an array, find the maximum sum of subarray close to k but not larger than k. Java Solution public int getLargestSumCloseToK(int [] arr...


Design a Data Structure with Insert & Delete & GetMostFrequent of O(1)
Design a data structure that allows O(1) time complexity to insert, delete and get most frequent element. Analysis At first, a hash map seem...


LeetCode – Kth Smallest Element in a Sorted Matrix (Java)
Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix. Note tha...


LeetCode – Shortest Word Distance III (Java)
This is a followup problem of Shortest Word Distance. The only difference is now word1 could be the same as word2. Given a list of words an...


Get Target Using Number List and Arithmetic Operations [Google]
Given a list of numbers and a target number, write a program to decide whether the target number can be reached with the list of other numbe...


Top 16 Java Utility Classes
In Java, a utility class is a class that defines a set of methods that perform common functions. The following shows the most frequently use...


Top 10 API Related Questions from Stack Overflow
Stack Overflow is a large repository of valuable programming knowledge. Millions of questions have been answered on Stack Overflow and many ...


Compile and run Eclipse Java projects from Linux terminal
If you are developing a Java project in Eclipse under a linux system, you may want to remote access the project from another location. You c...

