SHARE
TWEET

Untitled

a guest Feb 1st, 2018 112 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.*;class M{String p="";int F=9;HashMap<String,HashMap>P=new HashMap();void a(String k,String x){HashMap<String,W>X=P.get(k);if(X==null)P.put(k,X=new HashMap());W w=X.get(x);if(w==null)X.put(x,w=new W(x));w.f++;}String g(String t){if(P.get(t)!=null){List<W>q=new Stack();q.addAll(P.get(t).values());Collections.sort(q);return q.get(0).w;}return null;}String m(){String t=t(",")!=null?t(","):t(";")!=null?t(";"):t(":")!=null?t(":"):t(".")!=null?t("."):t("!")!=null?t("!"):t("?")!=null?t("?"):t(" ")!=null?t(" "):null;if(t!=null)return t;for(int x=0;x<p.length();)if((t=g(p.substring(x++)))!=null)return t;return"\n";}String t(String c){return p.contains(c)?g(p.substring(p.indexOf(c))):null;}String n(String n){if(p.length()<F)p+=n;else{for(int x=0;x<100;)a(p.substring(x++),n);p=p.substring(1)+n;}return m();}class W implements Comparable<W>{String w;int f=0;W(String t){w=t;}public int compareTo(W a){return Integer.compare(a.f,f);}}}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top