Schlagwörter » Java

17. Letter Combinations of a Phone Number

Given a digit string, return all possible letter combinations that the number could represent.

A mapping of digit to letters (just like on the telephone buttons) is given below. 184 weitere Wörter

Java

Java Design Pattern

Design patterns are only a formal dialect to characterize basic approaches to take care of programming building issues. … I think Design patterns are vital in light of the fact that they show you the order approaches to take care of the issues in the territories that outline designs apply to application. 62 weitere Wörter

Design Pattern

MAGNITUDE 5.4 JAVA, INDONESIA

https://earthquake.usgs.gov/earthquakes/eventpage/us10008uvz#executive

Subject to change

Depth: 73 km

Distances: 195 km SW of Surabaya, Indonesia / pop: 2,375,000 / local time: 23:44:54.9 2017-05-24
84 km S of Tulungagung, Indonesia / pop: 65,300 / local time: 23:44:54.9 2017-05-24… 10 weitere Wörter

Earthquake Alert

a script to install basic Java dev tools for Vagrant provision

#! /bin/bash
echo install jdk1.8
wget –no-cookies –no-check-certificate –header „Cookie: oraclelicense=accept-securebackup-cookie“ „http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm“
yum localinstall jdk-8u131-linux-x64.rpm -y
touch /etc/profile.d/java.sh
cat <<EOT >> /etc/profile.d/java.sh
export JAVA_HOME=“/usr/java/jdk1.8.0_131″ 461 weitere Wörter

Documentum: Software to Download Documents and Metadata

I have written a software in Java using DFC. This software performs the following tasks:

  1. Performs export or import of documentum data
  2. Download all documents given a folder/cabinet in Documentum…
  3. 85 weitere Wörter
Documentum

140. Word Break II

Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, add spaces in s to construct a sentence where each word is a valid dictionary word. 287 weitere Wörter

Java

56. Merge Intervals

Given a collection of intervals, merge all overlapping intervals.

For example,
Given ,,,,
return ,,.

/**
 * Definition for an interval.
 * public class Interval {
 *     int start;
 *     int end;
 *     Interval() { start = 0; end = 0; }
 *     Interval(int s, int e) { start = s; end = e; }
 * }
 */
public class Solution {
    public List<Interval> merge(List<Interval> intervals) {
        if (intervals == null || intervals.size() <= 1) return intervals;
        List<Interval> result = new ArrayList<>();
        // Collections.sort(intervals, new Comparator<Interval>() {
        //     @Override
        //     public int compare(Interval i1, Interval i2) {
        //         return i1.start - i2.start;
        //     }
        // });
        intervals.sort((i1, i2) -> i1.start - i2.start);

        int start = intervals.get(0).start;
        int end = intervals.get(0).end;
        for (Interval interval : intervals) {
            if (interval.start <= end) {
                // merge
                end = Math.max(end, interval.end);
            } else {
                // add to result;
                result.add(new Interval(start, end));
                start = interval.start;
                end = interval.end;
            }
        }
        result.add(new Interval(start, end));
        return result;
    }
}
Java